Re: cataloguing NOT NULL constraints

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: cataloguing NOT NULL constraints
Date: 2023-07-12 17:10:59
Message-ID: 20230712171059.4cqn7f7x3f4tdff3@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

v13, because a conflict was just committed to alter_table.sql.

Here I also call out the relcache.c change by making it a separate
commit. I'm likely to commit it that way, too. To recap: the change is
to have a partitioned table's index list include the primary key, even
when said primary key is marked invalid. This turns out to be necessary
for the currently proposed pg_dump strategy to work; if this is not in
place, attaching the per-partition PK indexes to the parent index fails
because it sees that the columns are not marked NOT NULL.

I don't see any obvious problem with this change; but if someone does
and this turns out to be unacceptable, then the pg_dump stuff would need
some surgery.

There are no other changes from v12. One thing I should probably get
to, is fixing the constraint name comparison code in pg_dump. Right now
it's a bit dumb and will get in silly trouble with overlength
table/column names (nothing that would actually break, just that it will
emit constraint names when there's no need to.)

Álvaro Herrera Breisgau, Deutschland —
Essentially, you're proposing Kevlar shoes as a solution for the problem
that you want to walk around carrying a loaded gun aimed at your foot.
(Tom Lane)

Attachment Content-Type Size
v13-0001-Remember-PK-oid-for-partitioned-tables-even-when.patch text/x-diff 1.8 KB
v13-0002-Add-pg_constraint-rows-for-NOT-NULL-constraints.patch text/x-diff 224.9 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Gurjeet Singh 2023-07-12 17:47:56 Re: Better help output for pgbench -I init_steps
Previous Message Tristan Partin 2023-07-12 16:55:50 Re: Meson build updates