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

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: shihao zhong <zhong950419(at)gmail(dot)com>
Cc: 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-23 06:06:11
Message-ID: CAFiTN-tQHfV05-CwPTg_e9Ko8rqVm8hWse3YDsi1Uqgv0UkQ0A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Nov 21, 2026 at 11:00 PM shihao zhong <zhong950419(at)gmail(dot)com> wrote:
>
> Hi Dilip,
>
> Thanks for the example, looks like this problem is not that simple.
>
> In v2 the foreign table fix comes first, since it is the one to
> back-patch. The code is unchanged. It applies to 16 through 19 as is,
> and I attached a version for 15.
>
> 0002 lets the existing DROP CONSTRAINT IF EXISTS skip a missing domain
> with a notice. We did the same for DROP TRIGGER IF EXISTS on a missing
> table in b152c6cd0de, also for pg_dump --clean. It changes behavior,
> so I think it is for master only.
>
> The other way is to add ALTER DOMAIN IF EXISTS. I preferred 0002
> because dump scripts from older pg_dump versions then work too and
> easy to implement.
>
> Let me know what you think.

I think 0002 make sense to me.

--
Regards,
Dilip Kumar
Google

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Dilip Kumar 2026-11-23 06:08:32 Re: BUG #19892: Logical replication skips UPDATE/DELETE of rows with NULL in a hash-indexed subscriber column
Previous Message Tom Lane 2026-11-23 01:06:02 Re: BUG #19911: Window aggregate over ROWS n FOLLOWING: "unexpected end of tuplestore" after spill