Re: group by true now errors with non-integer constant in GROUP BY - Mailing list pgsql-bugs

From Tom Lane
Subject Re: group by true now errors with non-integer constant in GROUP BY
Date
Msg-id 3970727.1697828605@sss.pgh.pa.us
Whole thread Raw
In response to Re: group by true now errors with non-integer constant in GROUP BY  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-bugs
Laurenz Albe <laurenz.albe@cybertec.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



pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: slow pg_dump with bytea
Next
From: PG Bug reporting form
Date:
Subject: BUG #18165: Could not duplicate handle for "Global/PostgreSQL.xxxxxxxxxx": Bad file descriptor