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 Update copyright for 2025 2025-01-01 11:21:55 -05:00
backup Update copyright for 2025 2025-01-01 11:21:55 -05:00
bootstrap pg_noreturn to replace pg_attribute_noreturn() 2025-03-13 12:37:26 +01:00
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 Use 'void *' for arbitrary buffers, 'uint8 *' for byte arrays 2025-05-08 22:01:25 +03:00
datatype Avoid using timezone Asia/Manila in regression tests. 2025-01-20 15:47:53 -05:00
executor Fix EvalPlanQual handling of foreign/custom joins in ExecScanFetch. 2025-10-15 17:15:01 +09:00
fe_utils Remove inappropriate inclusions of c.h and postgres_fe.h. 2025-04-27 16:58:57 -04:00
foreign Update copyright for 2025 2025-01-01 11:21:55 -05:00
jit Don't use double-quotes in #include's of system headers, redux. 2025-04-27 13:23:19 -04:00
lib Fix reset of incorrect hash iterator in GROUPING SETS queries 2025-10-18 16:07:41 +13:00
libpq Use 'void *' for arbitrary buffers, 'uint8 *' for byte arrays 2025-05-08 22:01:25 +03:00
mb With GB18030, prevent SIGSEGV from reading past end of allocation. 2025-05-05 04:52:04 -07:00
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 Revert support for improved tracking of nested queries 2025-06-12 10:08:55 +09:00
partitioning Fix incorrect #endif comment 2025-03-10 13:36:04 +13:00
pch Update copyright for 2025 2025-01-01 11:21:55 -05:00
port Fix O_CLOEXEC flag handling in Windows port. 2025-12-10 09:05:21 +13:00
portability Update copyright for 2025 2025-01-01 11:21:55 -05:00
postmaster Fix incorrect const qualifier 2025-09-16 07:23:50 +02:00
regex Update copyright for 2025 2025-01-01 11:21:55 -05:00
replication Make invalid primary_slot_name follow standard GUC error reporting. 2025-10-22 20:10:58 +09:00
rewrite Refactor ChangeVarNodesExtended() using the custom callback 2025-05-07 11:10:16 +03:00
snowball Update to latest Snowball sources. 2025-02-18 21:13:54 -05:00
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 Update copyright for 2025 2025-01-01 11:21:55 -05:00
utils ltree: fix case-insensitive matching. 2025-12-16 12:57:12 -08:00
.gitignore Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
c.h Remove INT64_HEX_FORMAT and UINT64_HEX_FORMAT 2025-08-06 10:58:06 +02:00
fmgr.h Avoid mixing designated and non-designated field initializers. 2025-03-27 11:06:30 -04:00
funcapi.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
getopt_long.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
Makefile Use <stdint.h> and <inttypes.h> for c.h integers. 2024-12-04 15:05:38 +13:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
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 Avoid invalidating all RelationSyncCache entries on publication rename. 2025-03-13 09:16:33 +05:30
pg_getopt.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
pg_trace.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
pgstat.h Don't include execnodes.h in replication/conflict.h 2025-09-25 14:52:19 +02:00
pgtar.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pgtime.h Seek zone abbreviations in the IANA data before timezone_abbreviations. 2025-01-16 14:11:19 -05:00
port.h Fix O_CLOEXEC flag handling in Windows port. 2025-12-10 09:05:21 +13:00
postgres.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
postgres_ext.h Move pg_int64 back to postgres_ext.h 2025-09-16 10:48:44 +02:00
postgres_fe.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
varatt.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
windowapi.h Update copyright for 2025 2025-01-01 11:21:55 -05:00