Example 2:
=> select * exclude (bar) from t1;
ERROR: 42703: column "bar" does not exist
Example 3:
=> select * exclude (foo) from t1;
ERROR: 02000: SELECT list is empty after excluding all columns
Example 5:
=> select * exclude (bar, bar) from t2;
ERROR: 42703: column "bar" does not exist
I will handle these cases in my next patch.
Example 6:
=> select * exclude (foo) from t1, t2;
ERROR: 02000: SELECT list is empty after excluding all columns
My paper proposes that this should be an error because foo is ambiguous.
While implementing the patch, I thought it could be useful to allow
this when selecting from multiple tables, as EXCLUDE can be
handy in such cases (as in the example Christoph mentioned).
However, since the proposal notes that only 1 of 5 implementations
allows this and the SQL group may not go in this direction, it seems
reasonable to follow the proposal... but perhaps we can also
leave it to implementations to decide?
Example 8:
=> select * exclude (t1.foo) from t1, t2;
ERROR: 02000: SELECT list is empty after excluding all columns
Example 11:
=> select foo, t1.* exclude (foo) from t1;
ERROR: 02000: SELECT list is empty after excluding all columns
Yes, these cases should work. They seem like bugs in my patch, I will fix them.
Hunaid Sohail