asterisk (non)expansion in GROUP BY clause - Mailing list pgsql-hackers

From Peter Eisentraut
Subject asterisk (non)expansion in GROUP BY clause
Date
Msg-id 1305835713.3952.14.camel@vanquo.pezone.net
Whole thread Raw
Responses Re: asterisk (non)expansion in GROUP BY clause  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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 by date:

Previous
From: Robert Haas
Date:
Subject: Re: moving toast table to its own tablespace
Next
From: Alvaro Herrera
Date:
Subject: Re: LOCK DATABASE