From: | Tobias Wendorff <tobias(dot)wendorff(at)tu-dortmund(dot)de> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-bugs(at)lists(dot)postgresql(dot)org |
Subject: | Re: BUG #17071: ORDER BY gets ignored when result set has only one row, but another one gets added by rollup() |
Date: | 2021-06-23 19:40:26 |
Message-ID: | 6574e1c6-fcb6-62fb-9de4-c9005feac87d@tu-dortmund.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Dear Tom,
On 23/06/2021 21:20 Tom Lane wrote:
> Hm, that's certainly a bug, but so far as I can tell it's specific
> to the case of a constant value being used as the GROUP BY/ORDER BY
> target.
> Which doesn't seem very likely to be interesting in practice.
> Do you have a non-toy example where things go wrong?
I'm a little bit surprised by your message. It is actually common to
make an example reproducible, but as small as possible. Please check
out the "KISS principle". It is therefore pretty unprofessional that
you devalue it as a "toy example".
Even this shorter example would have effectively shown the error:
SELECT 1 GROUP BY rollup(1) ORDER BY 1 NULLS FIRST;
To take some of the wind out of your criticism: Of course there is
a use case for the case. The whole thing stems from a complex query
and kept a colleague busy for a long time today because it led
tocompletely illogical results in some cases.
> So I'm wondering if this was reduced from a more realistic example
> that we might be able to fix in some other way.
To keep a long discussion short: you classify it as a wontfix.
Since I've already supplied a workaround (using a subquery or CTE),
let's close it.
Thanks,
Tobias
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2021-06-23 21:48:25 | Re: BUG #17071: ORDER BY gets ignored when result set has only one row, but another one gets added by rollup() |
Previous Message | Tom Lane | 2021-06-23 19:20:08 | Re: BUG #17071: ORDER BY gets ignored when result set has only one row, but another one gets added by rollup() |