From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Improve pg_clear_extended_stats() with incorrect relation/stats
Date: Fri, 16 Jan 2026 06:25:37 +0000
Message-ID: <E1vgdH6-000kqz-23@gemulon.postgresql.org> (raw)
Improve pg_clear_extended_stats() with incorrect relation/stats combination
Issue fat-fingered in d756fa1019ff, noticed while doing more review of
the main patch set proposed. I have missed the fact that this can be
triggered by specifying an extended stats object that does not match
with the relation specified and already locked. Like the cases where
an object defined in input is missing, the code is changed to issue a
WARNING instead of a confusing cache lookup failure.
A regression test is added to cover this case.
Discussion: https://postgr.es/m/CADkLM=dpz3KFnqP-dgJ-zvRvtjsa8UZv8wDAQdqho=qN3kX0Zg@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/395b73c045e02bbe5a33c10f57f528a4468a56f4
Modified Files
--------------
src/backend/statistics/extended_stats_funcs.c | 11 +++++++++--
src/test/regress/expected/stats_import.out | 12 ++++++++++++
src/test/regress/sql/stats_import.sql | 6 ++++++
3 files changed, 27 insertions(+), 2 deletions(-)
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: Improve pg_clear_extended_stats() with incorrect relation/stats
In-Reply-To: <E1vgdH6-000kqz-23@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