pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Don't use MinMaxAggPath if aggregate's input and output types do
3+ messages / 1 participants
[nested] [flat]

* pgsql: Don't use MinMaxAggPath if aggregate's input and output types do
@ 2026-11-09 14:21 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Noah Misch @ 2026-11-09 14:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't use MinMaxAggPath if aggregate's input and output types don't match.

A sort-operator option only makes sense for an aggregate that behaves
like MIN or MAX.  We can't really verify whether an aggregate does,
but for our purposes the most important expectation is that the
aggregate returns the same type as its input.  Without this, the
planner's conversion to a MinMaxAggPath plan risks type violations.
Since such aggregate definitions might already exist in the wild,
check this during planning and don't generate MinMaxAggPath if the
types don't match.

Reported-by: Zheng Yu <zheng@depthfirst.com>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Backpatch-through: 14-19
Security: CVE-2026-116331

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/75c0441bad98dda75b18cb2b7cf3d8c41e7bc631
Author: Tom Lane <tgl@sss.pgh.pa.us>

Modified Files
--------------
src/backend/optimizer/plan/planagg.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Don't use MinMaxAggPath if aggregate's input and output types do
@ 2026-11-09 14:21 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Noah Misch @ 2026-11-09 14:21 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't use MinMaxAggPath if aggregate's input and output types don't match.

A sort-operator option only makes sense for an aggregate that behaves
like MIN or MAX.  We can't really verify whether an aggregate does,
but for our purposes the most important expectation is that the
aggregate returns the same type as its input.  Without this, the
planner's conversion to a MinMaxAggPath plan risks type violations.
Since such aggregate definitions might already exist in the wild,
check this during planning and don't generate MinMaxAggPath if the
types don't match.

Reported-by: Zheng Yu <zheng@depthfirst.com>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Backpatch-through: 14-19
Security: CVE-2026-116331

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2c03c7c48fb6060155fd9d35fdcef40ddf0a28f6
Author: Tom Lane <tgl@sss.pgh.pa.us>

Modified Files
--------------
src/backend/optimizer/plan/planagg.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Don't use MinMaxAggPath if aggregate's input and output types do
@ 2026-11-09 14:22 Noah Misch <noah@leadboat.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Noah Misch @ 2026-11-09 14:22 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Don't use MinMaxAggPath if aggregate's input and output types don't match.

A sort-operator option only makes sense for an aggregate that behaves
like MIN or MAX.  We can't really verify whether an aggregate does,
but for our purposes the most important expectation is that the
aggregate returns the same type as its input.  Without this, the
planner's conversion to a MinMaxAggPath plan risks type violations.
Since such aggregate definitions might already exist in the wild,
check this during planning and don't generate MinMaxAggPath if the
types don't match.

Reported-by: Zheng Yu <zheng@depthfirst.com>
Author: Tom Lane <tgl@sss.pgh.pa.us>
Backpatch-through: 14-19
Security: CVE-2026-116331

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/dd2cd3803920a923d63380e91f8e0c17725d190c
Author: Tom Lane <tgl@sss.pgh.pa.us>

Modified Files
--------------
src/backend/optimizer/plan/planagg.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2026-11-09 14:22 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-09 14:21 pgsql: Don't use MinMaxAggPath if aggregate's input and output types do Noah Misch <noah@leadboat.com>
2026-11-09 14:21 pgsql: Don't use MinMaxAggPath if aggregate's input and output types do Noah Misch <noah@leadboat.com>
2026-11-09 14:22 pgsql: Don't use MinMaxAggPath if aggregate's input and output types do Noah Misch <noah@leadboat.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox