asterisk (non)expansion in GROUP BY clause

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема asterisk (non)expansion in GROUP BY clause
Дата
Msg-id 1305835713.3952.14.camel@vanquo.pezone.net
обсуждение исходный текст
Ответы Re: asterisk (non)expansion in GROUP BY clause
Список pgsql-hackers
Apparently, you can write this (an attempt at a convenient workaround
for lack of functional dependency tracking pre-9.1):

SELECT pg_class.* FROM pg_class GROUP BY pg_class.*;

It won't work:

ERROR:  42803: column "pg_class.relname" must appear in the GROUP BY clause or be used in an aggregate function

But the whole thing is a bit confusing.  This works (of course):

SELECT pg_class FROM pg_class GROUP BY pg_class;

And this behaves equivalently, apparently:

SELECT pg_class FROM pg_class GROUP BY pg_class.*;

Is there any rhyme or reason for this?  I couldn't find anything about
this in the documentation or in the SQL standard.  I guess the whole
thing is inconsistent all over the place; I'd just like to verify that
the current behavior is somewhat intentional.



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: moving toast table to its own tablespace
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: LOCK DATABASE