Re: BUG #19858: pg_dump --clean --if-exists fails on NOT VALID domain constraint

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: 125atishprak(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19858: pg_dump --clean --if-exists fails on NOT VALID domain constraint
Date: 2026-11-17 02:20:34
Message-ID: CAGRkXqTA-J7LDwdS7D2vE3M2bc8cjzs16RoZjpECsmd=NdOusQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thanks for the clear report. I can reproduce it on 17-master.

0001 skips the ALTER DOMAIN ... DROP CONSTRAINT when the domain itself
is being dropped too, since DROP DOMAIN removes the constraint anyway.

0002 fixes the same problem for NOT VALID constraints on foreign
tables.

The current implementation follows the pattern we already have.

Another way is to build the TOC dependencies for plain-text output as well
and
use them here. But that also changes the pg_dump -v output.

Thanks,
Shihao

Attachment Content-Type Size
v1-0001-Fix-pg_dump-clean-if-exists-for-NOT-VALID-domain-con.patch application/octet-stream 6.3 KB
v1-0002-Fix-pg_dump-clean-if-exists-for-foreign-table-constr.patch application/octet-stream 3.5 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Previous Message shihao zhong 2026-11-17 02:10:05 Re: Lost FOR KEY SHARE lock