pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_dump: Don't emit OVERRIDING SYSTEM VALUE for dropped identity
Date: Tue, 13 Oct 2026 04:19:19 +0000
Message-ID: <E1xGTyx-00000001PDM-3t7q@gemulon.postgresql.org> (raw)

pg_dump: Don't emit OVERRIDING SYSTEM VALUE for dropped identity columns

When a table's only GENERATED ALWAYS AS IDENTITY column had been
dropped, pg_dump --inserts and --column-inserts could still emit
OVERRIDING SYSTEM VALUE in INSERT statements. This clause has no effect
when restoring into PostgreSQL but introduces unnecessary differences
between dumps of otherwise equivalent tables.

ALTER TABLE ... DROP COLUMN leaves pg_attribute.attidentity unchanged.
getTableAttrs() used this field to set needs_override without checking
attisdropped, so a dropped identity column could trigger the clause even
when no remaining column required it.

Ignore dropped columns when determining whether to emit the clause, so
that the output reflects only the table's remaining columns.

Apply to master only, since the unnecessary clause does not affect
restoration into PostgreSQL and does not warrant backpatching.

Author: William Bernbaum <wbernbaum@dwdev.com>
Reviewed-by: Andreas Karlsson <andreas@proxel.se>
Reviewed-by: solai v <solai.cdac@gmail.com>
Reviewed-by: shihao zhong <zhong950419@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/PH0PR18MB44430C10F7431F8D163CDAFFA6202@PH0PR18MB4443.namprd18.prod.outlook.com

Branch
------
master

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

Modified Files
--------------
src/bin/pg_dump/pg_dump.c        | 11 ++++++-
src/bin/pg_dump/t/002_pg_dump.pl | 67 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 77 insertions(+), 1 deletion(-)



Message-ID: <E1xGTyx-00000001PDM-3t7q@gemulon.postgresql.org>
Permalink:  ../E1xGTyx-00000001PDM-3t7q@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xGTyx-00000001PDM-3t7q@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: fujii@postgresql.org
  Subject: Re: pgsql: pg_dump: Don't emit OVERRIDING SYSTEM VALUE for dropped identity
  In-Reply-To: <E1xGTyx-00000001PDM-3t7q@gemulon.postgresql.org>
  References: <E1xGTyx-00000001PDM-3t7q@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