Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtunW-00EprP-Dk for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Oct 2023 19:04:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qtumU-0061EA-FQ for pgsql-bugs@arkaria.postgresql.org; Fri, 20 Oct 2023 19:03:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtumU-0061E2-6T for pgsql-bugs@lists.postgresql.org; Fri, 20 Oct 2023 19:03:34 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtumS-001TJt-3P for pgsql-bugs@lists.postgresql.org; Fri, 20 Oct 2023 19:03:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 39KJ3PZI3970728; Fri, 20 Oct 2023 15:03:25 -0400 From: Tom Lane To: Laurenz Albe cc: Vik Fearing , Dennis Brouwer , John Naylor , David Micallef , Peter Eisentraut , pgsql-bugs@lists.postgresql.org Subject: Re: group by true now errors with non-integer constant in GROUP BY In-reply-to: <10a3ef130cd6d757690be076a6f47fe9351026d2.camel@cybertec.at> References: <837886.1693252560@sss.pgh.pa.us> <3af446dd6fbfdb6e08de95fc24e06081f78a6f15.camel@cybertec.at> <18ba0d29-0637-48c5-a11d-19f8672a8b0f@postgresfriends.org> <10a3ef130cd6d757690be076a6f47fe9351026d2.camel@cybertec.at> Comments: In-reply-to Laurenz Albe message dated "Fri, 20 Oct 2023 08:32:57 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3970726.1697828605.1@sss.pgh.pa.us> Date: Fri, 20 Oct 2023 15:03:25 -0400 Message-ID: <3970727.1697828605@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Laurenz Albe 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