On Mon, Jan 12, 2026 at 04:20:44PM +0800, jian he wrote:
> While working on it, I guess I found another bug, below JumbleQuery will return
> the same result:
>
> SELECT FROM (VALUES (1::INT, 2::INT)) AS t(a, b) ORDER BY a, b;
> SELECT a FROM (VALUES (1::INT, 2::INT)) AS t(a, b) ORDER BY a, b;
> SELECT a, b FROM (VALUES (1::INT, 2::INT)) AS t(a, b) ORDER BY a, b;
>
> so I think TargetEntry.resjunk should not be marked as query_jumble_ignore.
Not sure how to feel about this one, as a primary node. 3db72ebcbe20
has put a query_jumble_ignore to TargetEntry.resjunk which was simply
a consistent move with the pre-v15 branches because these columns have
always been ignored. I have never heard complaints about that in the
field with PGSS, TBH. The original choice comes from this thread,
back in 2012 when this was still integrated into PGSS:
https://www.postgresql.org/message-id/CAEYLb_WGeFCT7MfJ8FXf-CR6BSE6Lbn%2BO1VX3%2BOGrc4Bscn4%3DA%40mail.gmail.com
Anyway, let's not mix apples and oranges for now. The GROUP BY issue
is a bug worth fixing on its own. What you are pointing out with
resjunk is the original behavior we have been relying on. If we
finish by changing it, this should not and cannot be backpatched.
I have expanded a bit the tests, with a couple of extra patterns,
giving the attached. The behavior is the same as the pre-v17
branches.
--
Michael