pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix handling of nested values in "exprs" for pg_restore_extended
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix handling of nested values in "exprs" for pg_restore_extended
@ 2026-11-04 01:56 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2026-11-04 01:56 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix handling of nested values in "exprs" for pg_restore_extended_stats()

check_all_expr_argnames_valid() iterated over the keys of each
expression object without skipping nested containers, so an unknown key
whose value is an array or an object broke the expected key/value token
sequence.  This caused an assertion failure, or an infinite loop that
cannot be canceled in non-assert builds.

This issue is fixed by skipping any nested containers, as we expect a
single array with a single sets of key/value pairs.

While on it, remove an unused allocation of the invalid key name.
This one has been noticed in passing.

Author: Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/f0034efa-66fb-4963-9872-c089dd021007@tantorlabs.com
Backpatch-through: 19

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f1d69bb7dfc2021091281b7063fe76c6ffcb9613

Modified Files
--------------
src/backend/statistics/extended_stats_funcs.c |  8 ++------
src/test/regress/expected/stats_import.out    | 14 ++++++++++++++
src/test/regress/sql/stats_import.sql         |  9 +++++++++
3 files changed, 25 insertions(+), 6 deletions(-)



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

* pgsql: Fix handling of nested values in "exprs" for pg_restore_extended
@ 2026-11-04 01:56 Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2026-11-04 01:56 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix handling of nested values in "exprs" for pg_restore_extended_stats()

check_all_expr_argnames_valid() iterated over the keys of each
expression object without skipping nested containers, so an unknown key
whose value is an array or an object broke the expected key/value token
sequence.  This caused an assertion failure, or an infinite loop that
cannot be canceled in non-assert builds.

This issue is fixed by skipping any nested containers, as we expect a
single array with a single sets of key/value pairs.

While on it, remove an unused allocation of the invalid key name.
This one has been noticed in passing.

Author: Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/f0034efa-66fb-4963-9872-c089dd021007@tantorlabs.com
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e03b69e54e01cbe2ee3ba1182be4bc25c7e4f7b4

Modified Files
--------------
src/backend/statistics/extended_stats_funcs.c |  8 ++------
src/test/regress/expected/stats_import.out    | 14 ++++++++++++++
src/test/regress/sql/stats_import.sql         |  9 +++++++++
3 files changed, 25 insertions(+), 6 deletions(-)



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


end of thread, other threads:[~2026-11-04 01:56 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04 01:56 pgsql: Fix handling of nested values in "exprs" for pg_restore_extended Michael Paquier <michael@paquier.xyz>
2026-11-04 01:56 pgsql: Fix handling of nested values in "exprs" for pg_restore_extended Michael Paquier <michael@paquier.xyz>

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