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-11-03 19:44:16
Message-ID: 20221103194416.sdp75teipw4i5hri@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2022-Oct-05, Alvaro Herrera wrote:

> 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.

I have pushed the fix for this 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.

There was no bug here actually: it's true that the struct member is left
uninitialized, but in practice that doesn't matter, because the set of
columns is propagated separately from the node.

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"Las navajas y los monos deben estar siempre distantes" (Germán Poo)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2022-11-03 20:23:01 Re: On login trigger: take three
Previous Message Jonathan S. Katz 2022-11-03 18:21:18 Re: heavily contended lwlocks with long wait queues scale badly