agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Reject oversized MCV lists in pg_restore_extended_stats()
Date: Tue, 16 Jun 2026 06:15:32 +0000
Message-ID: <E1wZN59-000WGn-2i@gemulon.postgresql.org> (raw)

Reject oversized MCV lists in pg_restore_extended_stats()

import_mcv(), called by pg_restore_extended_stats(), allowed a list of
MCV items to be larger than the maximum supported when the stats are
loaded back in statext_mcv_deserialize() (STATS_MCVLIST_MAX_ITEMS or 10k
items).  A follow-up attempt at loading them would cause a failure,
statext_mcv_deserialize() blocking any attempts.

Attempts at restoring MCV lists too long are now rejected, generating a
WARNING like other inconsistent inputs.

Author: Ewan Young <kdbase.hack@gmail.com>
Discussion: https://postgr.es/m/CAON2xHORd2ESXm1KcVeeZ0Kd_aJk4dL4M2WLtzVDM4puaZ-20w@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/statistics/extended_stats_funcs.c | 15 +++++++++++++++
src/test/regress/expected/stats_import.out    | 19 +++++++++++++++++++
src/test/regress/sql/stats_import.sql         | 14 ++++++++++++++
3 files changed, 48 insertions(+)



Message-ID: <E1wZN59-000WGn-2i@gemulon.postgresql.org>
Permalink:  ../E1wZN59-000WGn-2i@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wZN59-000WGn-2i@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Reject oversized MCV lists in pg_restore_extended_stats()
  In-Reply-To: <E1wZN59-000WGn-2i@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox