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

jian he <jian.universality@gmail.com>

From: jian he <jian.universality@gmail.com>
To: Álvaro Herrera <alvherre@kurilemu.de>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-07-18T14:44:26Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix pg_dump COMMENT dependency for separate domain constraints.

  2. pg_dump: include comments on not-null constraints on domains, too

  3. Fix dumping of comments on invalid constraints on domains

  4. Catalog domain not-null constraints

  5. In pg_dump, don't dump a stats object unless dumping underlying table.

  6. Enable CHECK constraints to be declared NOT VALID

On Fri, Jul 18, 2025 at 5:11 AM Álvaro Herrera <alvherre@kurilemu.de> wrote:
>
> Anyway, here's a patch.
>
one minor issue in getDomainConstraints:

 for (int i = 0, j = 0; i < ntups; i++)
{
        char        contype = (PQgetvalue(res, i, i_contype))[0];
        ....
        constraint->contype = *(PQgetvalue(res, i, i_contype));
}

for the same code simplicity,
``constraint->contype = *(PQgetvalue(res, i, i_contype));``
can change to
`` constraint->contype = contype;  ``
?
other than that, looks good to me.