Re: pg_dump does not dump domain not-null constraint's comments

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: jian he <jian(dot)universality(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_dump does not dump domain not-null constraint's comments
Date: 2025-09-13 11:59:29
Message-ID: 202509131159.p74ngjfov4l6@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025-Sep-12, Noah Misch wrote:

> The last argument gives the dump object on which the comment has a dependency.
> Since this is the case of a separately-dumped constraint, the comment needs to
> depend on that constraint (coninfo), not on the domain (tyinfo):
>
> - coninfo->dobj.catId, 0, tyinfo->dobj.dumpId);
> + coninfo->dobj.catId, 0, coninfo->dobj.dumpId);
>
> I didn't encounter a failure from this, but sufficient restore parallelism
> might reach a failure. A failure would look like a "does not exist" error in
> the COMMENT command, due to the constraint not yet existing.
> dumpTableConstraintComment() is an older case that optimally handles the last
> dumpComment() arg.

Sounds sane.

> In the absence of objections, I'll make it so.

Please do, thanks.

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mihail Nikalayeu 2025-09-13 12:07:33 Re: [BUG?] check_exclusion_or_unique_constraint false negative
Previous Message Alexander Korotkov 2025-09-13 09:35:35 Re: High CPU consumption in cascade replication with large number of walsenders