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

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: Dennis Brouwer <dennis(dot)brouwer(at)kizitos(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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" <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-19 13:33:11
Message-ID: CAKFQuwYA2OFk1e-0D1f1=c2fSZmemKXc=X_BwUB3a_ewNHPSpg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thursday, October 19, 2023, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
wrote:

> On Thu, 2023-10-19 at 14:07 +0200, Dennis Brouwer wrote:
> > Hibernate is a widely used framework and this library will compose
> queries
> > (under certain conditions (still unknown to me))
> > with GROUP BY coulmn1, column2, true <--
> >
> > Hibernate has been doing this quircky thing for many many years and even
> > in the latest release does so. So, potentionally many Java Enterprise
> > applications will be tied to postgresql-14 if there is no compatibility
> > switch possible.
> >
> > In our case a tiny compatability switch would be a livesaver. Of courcse,
> > I will try to convince the Hibernate community to have this unnecessary
> > constant removed but that still leaves all legacy code to not work with
> > postgresql-15+ databases which would be pitiful!
>
> I understand your pain.
>
> But according to my reading of the SQL standard, it only allows for
> regular column references in GROUP BY. Unless I got something wrong,
> that would mean the the ball is in Hibernate's court. It ought to
> produce correct SQL.
>

My takeaway is that if Hibernate is able to produce this and get away with
it in the various jdbc drivers it needs to work with then our existing
choice to extend beyond the standard seems justified as others must be
doing it as well. Introducing a regression now on the basis of standard
conformance is just going to harm our reputation with minimal benefit, all
seemingly accrued by developers, not users.

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2023-10-19 19:01:19 Re: Variable substitution in jsonb functions fails for jsonpath operator like_regex
Previous Message Laurenz Albe 2023-10-19 13:18:00 Re: group by true now errors with non-integer constant in GROUP BY