agora inbox for pgsql-bugs@postgresql.org
help / color / mirror / Atom feedFrom: Tom Lane <tgl@sss.pgh.pa.us>
To: Andrey Rachitskiy <pl0h0yp1@gmail.com>
Cc: malis@pgrust.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19619: WHERE scale(n) = 1 pushed past GROUP BY / window PARTITION BY, wrong COUNT
Date: Fri, 14 Aug 2026 14:51:03 -0400
Message-ID: <3777654.1786733463@sss.pgh.pa.us> (raw)
In-Reply-To: <CAB8bMiu2POh0dcsjUaqCwaABZcdNkm73ymcU10F3=2Qz8rKsgw@mail.gmail.com>
References: <19619-fc646db1c6b2dc90@postgresql.org>
<CAB8bMiu2POh0dcsjUaqCwaABZcdNkm73ymcU10F3=2Qz8rKsgw@mail.gmail.com>
Andrey Rachitskiy <pl0h0yp1@gmail.com> writes:
> Tom's view on the HAVING form was that the query is ill-posed.
> The group's representative among equal numerics is unspecified, so
> HAVING scale(c) = 1 after grouping is not well defined.
> https://postgr.es/m/1738062.1784927903@sss.pgh.pa.us
Yeah. I'd be more excited about doing something about this if we'd
required opclasses to say whether their equality operator is image
equality or something weaker. But that was never designed into the
system, and retrofitting it now would be a mess. Since the only
benefit would be to queries that are arguably wrong anyway, it's
difficult to justify the effort.
regards, tom lane
view thread (3+ messages)
Message-ID: <3777654.1786733463@sss.pgh.pa.us>
Permalink: ../3777654.1786733463@sss.pgh.pa.us/
Also on: postgresql.org/message-id/3777654.1786733463@sss.pgh.pa.us
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, pl0h0yp1@gmail.com, malis@pgrust.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19619: WHERE scale(n) = 1 pushed past GROUP BY / window PARTITION BY, wrong COUNT
In-Reply-To: <3777654.1786733463@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox