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

Amul Sul <sulamul@gmail.com>

From: Amul Sul <sulamul@gmail.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Dean Rasheed <dean.a.rasheed@gmail.com>, Aleksander Alekseev <aleksander@timescale.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>, vignesh C <vignesh21@gmail.com>
Date: 2024-03-08T05:58:00Z
Lists: pgsql-hackers
On Thu, Mar 7, 2024 at 11:02 PM Alvaro Herrera <alvherre@alvh.no-ip.org>
wrote:

> On 2024-Mar-07, Alvaro Herrera wrote:
>
> > Maybe we can add a flag RelationData->rd_ispkdeferred, so that
> > RelationGetPrimaryKeyIndex returned InvalidOid for deferrable PKs; then
> > logical replication would continue to not know about this PK, which
> > perhaps is what we want.  I'll do some testing with this.
>
> This seems to work okay.
>

Thank you for working on this, the patch works nicely.

Regards,
Amul

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.