[COMMITTERS] pgsql: Give a better error for duplicate entries in VACUUM/ANALYZEcolu - Mailing list pgsql-committers

From Tom Lane
Subject [COMMITTERS] pgsql: Give a better error for duplicate entries in VACUUM/ANALYZEcolu
Date
Msg-id E1dv9jI-0006oZ-Gf@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Give a better error for duplicate entries in VACUUM/ANALYZE column list.

Previously, the code didn't think about this case and would just try to
analyze such a column twice.  That would fail at the point of inserting
the second version of the pg_statistic row, with obscure error messsages
like "duplicate key value violates unique constraint" or "tuple already
updated by self", depending on context and PG version.  We could allow
the case by ignoring duplicate column specifications, but it seems better
to reject it explicitly.

The bogus error messages seem like arguably a bug, so back-patch to
all supported versions.

Nathan Bossart, per a report from Michael Paquier, and whacked
around a bit by me.

Discussion: https://postgr.es/m/E061A8E3-5E3D-494D-94F0-E8A9B312BBFC@amazon.com

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/122289a66b92799885917953907d5b3f3f9e6ac2

Modified Files
--------------
src/backend/commands/analyze.c       | 13 ++++++++++++-
src/test/regress/expected/vacuum.out |  5 +++++
src/test/regress/sql/vacuum.sql      |  4 ++++
3 files changed, 21 insertions(+), 1 deletion(-)


--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

pgsql-committers by date:

Previous
From: Andrew Dunstan
Date:
Subject: [COMMITTERS] pgsql: Quieten warnings about unused variables
Next
From: Andrew Dunstan
Date:
Subject: [COMMITTERS] pgsql: Provide a test for variable existence in psql