Re: group by true now errors with non-integer constant in GROUP BY

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Vik Fearing <vik(at)postgresfriends(dot)org>, Dennis Brouwer <dennis(dot)brouwer(at)kizitos(dot)com>, John Naylor <john(dot)naylor(at)enterprisedb(dot)com>, David Micallef <david(dot)j(dot)micallef(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: group by true now errors with non-integer constant in GROUP BY
Date: 2023-10-20 19:03:25
Message-ID: 3970727.1697828605@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> writes:
> I agree that it is desirable to fix this regression.

It's not a regression. If anything, it's a bug fix, because the
code is now doing what it intended to do all along: reject all
non-integral constants. The previous behavior was exposing an
implementation detail, namely that "true" wasn't a simple literal
constant according to the older grammar. But all of these were
and still are rejected:

GROUP BY 'true';
GROUP BY 1.0;
GROUP BY null;

I'm not really satisfied with concluding that we need to be
bug-compatible (literally) with an old implementation wart forever.

> Still, we shouldn't exonerate Hibernate from fixing the junk SQL
> it produces.

I'm curious as to how this incompatibility escaped notice for a full
year. Does Hibernate emit this SQL only in narrow corner cases?

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2023-10-20 20:18:08 BUG #18165: Could not duplicate handle for "Global/PostgreSQL.xxxxxxxxxx": Bad file descriptor
Previous Message Alvaro Herrera 2023-10-20 13:18:19 Re: slow pg_dump with bytea