pgsql: Fix dumping of comments on invalid constraints on domains

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix dumping of comments on invalid constraints on domains
Date: 2025-07-16 17:23:59
Message-ID: E1uc5rL-006cTZ-0q@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix dumping of comments on invalid constraints on domains

We skip dumping constraints together with domains if they are invalid
('separate') so that they appear after data -- but their comments were
dumped together with the domain definition, which in effect leads to the
comment being dumped when the constraint does not yet exist. Delay
them in the same way.

Oversight in 7eca575d1c28; backpatch all the way back.

Author: jian he <jian(dot)universality(at)gmail(dot)com>
Discussion: https://postgr.es/m/CACJufxF_C2pe6J_+nPr6C5jf5rQnbYP8XOKr4HM8yHZtp2aQqQ@mail.gmail.com

Branch
------
REL_18_STABLE

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

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 23 ++++++++++++++++++++++-
src/test/regress/expected/constraints.out | 4 ++++
src/test/regress/sql/constraints.sql | 6 ++++++
3 files changed, 32 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2025-07-16 21:14:25 pgsql: Force LC_COLLATE to C in postmaster.
Previous Message Peter Geoghegan 2025-07-16 17:06:30 pgsql: nbtree: Use only one notnullkey ScanKeyData.