Re: [HACKERS] GROUP BY fixes committed - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] GROUP BY fixes committed
Date
Msg-id 199905101833.OAA04816@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] GROUP BY fixes committed  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> ACCEPTED:
> insert into si_tmpVerifyAccountBalances select invoiceid+3,
> memberid, 1, TotShippingHandling from InvoiceLineDetails
> group by invoiceid+3, memberid;
> 
> NOT ACCEPTED:
> insert into si_tmpVerifyAccountBalances select invoiceid+3,
> memberid, 1, TotShippingHandling from InvoiceLineDetails
> group by invoiceid+3, memberid, TotShippingHandling;
> 
> Probably error check is including GROUP BY targets in its count of
> things-to-be-inserted :-(.  The behavior is quite inconsistent though.
> Also, why doesn't the first example get rejected, since
> TotShippingHandling is neither GROUP BY nor an aggregate??

Yikes.  We check to make sure all non-agg columns are referenced in
GROUP BY, but not that all GROUP BY's are in target list, perhaps?

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: jwieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] numeric & decimal
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Lost my mailbox