Re: Dump-restore loosing 'attnotnull' bit for DEFERRABLE PRIMARY KEY column(s).

Aleksander Alekseev <aleksander@timescale.com>

From: Aleksander Alekseev <aleksander@timescale.com>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: Amul Sul <sulamul@gmail.com>, vignesh C <vignesh21@gmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2024-03-04T12:34:20Z
Lists: pgsql-hackers
Hi hackers,

>> I did not see any test addition for this, can we add it?
>
>
> Ok, added it in the attached version.
>
> This was an experimental patch, I was looking for the comment on the proposed
> approach -- whether we could simply skip the throwaway NOT NULL constraint for
> deferred PK constraint.  Moreover,  skip that for any PK constraint.

I confirm that the patch fixes the bug. All the tests pass. Looks like
RfC to me.

-- 
Best regards,
Aleksander Alekseev



Commits

  1. Revert structural changes to not-null constraints

  2. Admit deferrable PKs into rd_pkindex, but flag them as such

  3. Add the notion of REPLICA IDENTITY for a table.