]> git.ipfire.org Git - thirdparty/postgresql.git/commit
pg_plan_advice: Avoid assertion failure with partitionwise aggregate.
authorRobert Haas <rhaas@postgresql.org>
Mon, 30 Mar 2026 13:58:25 +0000 (09:58 -0400)
committerRobert Haas <rhaas@postgresql.org>
Mon, 30 Mar 2026 13:58:25 +0000 (09:58 -0400)
commite2ee95233cab32a0d5fe64925aefe816c13dbbc0
tree1bad07e3e655373289d543c1e38bc2a86c4f8fde
parent39dcd10a2c493821cc88a9f8d17677507571e87d
pg_plan_advice: Avoid assertion failure with partitionwise aggregate.

An Append node that is part of a partitionwise aggregate has no
apprelids. If such a node was elided, the previous coding would
attempt to call unique_nonjoin_rtekind() on a NULL pointer, which
leads to an assertion failure. Insert a NULL check to prevent that.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Discussion: http://postgr.es/m/0afba1ce-c946-4131-972d-191d9a1c097c@gmail.com
contrib/pg_plan_advice/pgpa_scan.c