postgresql/src/include
Michael Paquier 9c3caad026 Fix query jumbling with GROUP BY clauses
RangeTblEntry.groupexprs was marked with the node attribute
query_jumble_ignore, causing a list of GROUP BY expressions to be
ignored during the query jumbling.  For example, these two queries could
be grouped together within the same query ID:
SELECT count(*) FROM t GROUP BY a;
SELECT count(*) FROM t GROUP BY b;

However, as such queries use different GROUP BY clauses, they should be
split across multiple entries.

This fixes an oversight in 247dea89f7, that has introduced an RTE for
GROUP BY clauses.  Query IDs are documented as being stable across minor
releases, but as this is a regression new to v18 and that we are still
early in its support cycle, a backpatch is exceptionally done as this
has broken a behavior that exists since query jumbling is supported in
core, since its introduction in pg_stat_statements.

The tests of pg_stat_statements are expanded to cover this area, with
patterns involving GROUP BY and GROUPING clauses.

Author: Jian He <jian.universality@gmail.com>
Discussion: https://postgr.es/m/CACJufxEy2W+tCqC7XuJ94r3ivWsM=onKJp94kRFx3hoARjBeFQ@mail.gmail.com
Backpatch-through: 18
2026-01-14 08:44:52 +09:00
..
access Introduce XLogRecPtrIsValid() 2025-11-06 19:08:29 +01:00
archive
backup
bootstrap
catalog Fix a deadlock during ALTER SUBSCRIPTION ... DROP PUBLICATION. 2025-08-01 07:46:22 +00:00
commands Fix bug where we truncated CLOG that was still needed by LISTEN/NOTIFY 2025-11-12 21:00:42 +02:00
common
datatype
executor Fix EvalPlanQual handling of foreign/custom joins in ExecScanFetch. 2025-10-15 17:15:01 +09:00
fe_utils
foreign
jit
lib Fix reset of incorrect hash iterator in GROUPING SETS queries 2025-10-18 16:07:41 +13:00
libpq
mb
nodes Fix query jumbling with GROUP BY clauses 2026-01-14 08:44:52 +09:00
optimizer Strip PlaceHolderVars from index operands 2025-12-29 11:43:06 +09:00
parser
partitioning
pch
port Fix O_CLOEXEC flag handling in Windows port. 2025-12-10 09:05:21 +13:00
portability
postmaster Fix incorrect const qualifier 2025-09-16 07:23:50 +02:00
regex
replication Make invalid primary_slot_name follow standard GUC error reporting. 2025-10-22 20:10:58 +09:00
rewrite
snowball
statistics Fix redefinition of typedef RangeVar. 2025-10-15 13:14:00 -05:00
storage aio: Stop using enum bitfields due to bad code generation 2025-08-27 19:12:50 -04:00
tcop Sync typedefs.list with the buildfarm. 2025-06-15 13:04:24 -04:00
tsearch
utils ltree: fix case-insensitive matching. 2025-12-16 12:57:12 -08:00
.gitignore
c.h Remove INT64_HEX_FORMAT and UINT64_HEX_FORMAT 2025-08-06 10:58:06 +02:00
fmgr.h
funcapi.h
getopt_long.h
Makefile
meson.build
miscadmin.h Avoid mixing void and integer in a conditional expression. 2025-11-02 12:31:01 -05:00
pg_config.h.in aio: Combine io_uring memory mappings, if supported 2025-07-07 21:04:03 -04:00
pg_config_manual.h
pg_getopt.h
pg_trace.h
pgstat.h Don't include execnodes.h in replication/conflict.h 2025-09-25 14:52:19 +02:00
pgtar.h
pgtime.h
port.h Fix O_CLOEXEC flag handling in Windows port. 2025-12-10 09:05:21 +13:00
postgres.h
postgres_ext.h Move pg_int64 back to postgres_ext.h 2025-09-16 10:48:44 +02:00
postgres_fe.h
varatt.h
windowapi.h