Re: [BUG] parenting a PK constraint to a self-FK one (Was: Self FK oddity when attaching a partition)

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Jehan-Guillaume de Rorthais <jgdr(at)dalibo(dot)com>
Cc: Zhihong Yu <zyu(at)yugabyte(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [BUG] parenting a PK constraint to a self-FK one (Was: Self FK oddity when attaching a partition)
Date: 2022-10-05 10:55:23
Message-ID: 20221005105523.bhuhkdx4olajboof@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2022-Oct-03, Jehan-Guillaume de Rorthais wrote:

> Thank you! This is fixed and rebased on current master branch in patches
> attached.

Thanks. As far as I can see this fixes the bugs that were reported.
I've been giving the patches a look and it caused me to notice two
additional bugs in the same area:

- FKs in partitions are sometimes marked NOT VALID. This is because of
missing initialization when faking up a Constraint node in
CloneFkReferencing. Easy to fix, have patch, running tests now.

- The feature added by d6f96ed94e73 (ON DELETE SET NULL (...)) is not
correctly propagated. This should be an easy fix also, haven't tried,
need to add a test case.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"La primera ley de las demostraciones en vivo es: no trate de usar el sistema.
Escriba un guión que no toque nada para no causar daños." (Jakob Nielsen)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey Lepikhov 2022-10-05 11:38:10 Re: [POC] Allow flattening of subquery with a link to upper query
Previous Message Dagfinn Ilmari Mannsåker 2022-10-05 10:36:36 Re: Add meson.build to version_stamp.pl