pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix handling of nested values in "exprs" for pg_restore_extended
Date: Wed, 04 Nov 2026 01:56:29 +0000
Message-ID: <E1xOQEo-000000005nj-0ReI@gemulon.postgresql.org> (raw)

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(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1xOQEo-000000005nj-0ReI@gemulon.postgresql.org>
Permalink:  ../E1xOQEo-000000005nj-0ReI@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xOQEo-000000005nj-0ReI@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Fix handling of nested values in "exprs" for pg_restore_extended
  In-Reply-To: <E1xOQEo-000000005nj-0ReI@gemulon.postgresql.org>
  References: <E1xOQEo-000000005nj-0ReI@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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