pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@kurilemu.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix pg_dump for inherited validated not-null constraints
Date: Mon, 28 Apr 2025 14:42:35 +0000
Message-ID: <E1u9Pgp-00017F-1n@gemulon.postgresql.org> (raw)

Fix pg_dump for inherited validated not-null constraints

When a child constraint is validated and the parent constraint it
derives from isn't, pg_dump must be coerced into printing the child
constraint; failing to do would result in a dump that restores the
constraint as not valid, which would be incorrect.

Co-authored-by: jian he <jian.universality@gmail.com>
Co-authored-by: Álvaro Herrera <alvherre@kurilemu.de>
Reported-by: jian he <jian.universality@gmail.com>
Message-id: https://postgr.es/m/CACJufxGHNNMc0E2JphUqJMzD3=bwRSuAEVBF5ekgkG8uY0Q3hg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0e13b13d26e870cb18fe6ecf9f8697ddfcf2c740

Modified Files
--------------
src/bin/pg_dump/common.c                  | 26 ++++++++++++--
src/bin/pg_dump/pg_dump.c                 | 20 ++++++++---
src/bin/pg_dump/pg_dump.h                 |  1 +
src/bin/pg_dump/t/002_pg_dump.pl          | 59 +++++++++++++++++++++++++++++--
src/test/regress/expected/constraints.out | 34 ++++++++++++++++++
src/test/regress/sql/constraints.sql      | 18 ++++++++++
6 files changed, 149 insertions(+), 9 deletions(-)



Message-ID: <E1u9Pgp-00017F-1n@gemulon.postgresql.org>
Permalink:  ../E1u9Pgp-00017F-1n@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1u9Pgp-00017F-1n@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: alvherre@kurilemu.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix pg_dump for inherited validated not-null constraints
  In-Reply-To: <E1u9Pgp-00017F-1n@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