Re: Proposal: SELECT * EXCLUDE (...) command

Поиск
Список
Период
Сортировка
От Hunaid Sohail
Тема Re: Proposal: SELECT * EXCLUDE (...) command
Дата
Msg-id CAMWA6yZZ2-+Fo0Nw0mhdEZPcLi4d5f85FZ7Z9o4fP9JLdX3=Cg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Proposal: SELECT * EXCLUDE (...) command  (Peter Eisentraut <peter@eisentraut.org>)
Список pgsql-hackers
Hi,

On Wed, Jan 14, 2026 at 1:28 AM Peter Eisentraut <peter@eisentraut.org> wrote:
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.

Regards,
Hunaid Sohail

В списке pgsql-hackers по дате отправления: