From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: jian he <jian.universality@gmail.com>
Cc: Amul Sul <sulamul@gmail.com>
Cc: Tender Wang <tndrwang@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org, Antonin Houska <ah@cybertec.at>
Subject: Re: Foreign key validation failure in 18beta1
Date: Thu, 5 Jun 2025 19:01:06 +0200
Message-ID: <202506051701.wjgu2jhnksb5@alvherre.pgsql> (raw)
In-Reply-To: <CACJufxE0KRLtrapdQOYw1TW+BbfcbLrng7S7fzDz+M_T1RDknw@mail.gmail.com>
On 2025-Jun-04, jian he wrote:
> On Tue, Jun 3, 2025 at 12:14 PM Amul Sul <sulamul@gmail.com> wrote:
>
> > I found a third approach that requires only a few changes. The key
> > idea is to determine the root referenced table and pass it to
> > QueueFKConstraintValidation(). We would then enqueue phase 3
> > validation only if the constraint tuple’s confrelid matches that root
> > table -- similar to what is doing in ATExecAlterConstrEnforceability().
> >
> > This would also ensure that the logic for adding/skipping phase 3
> > validation is consistent in both places.
>
> indeed!
>
> v7 is way more intuitive compared with v5, v6.
Agreed, this version is better than the previous ones. I split it as
two commits, for NOT VALID and NOT ENFORCED separately, and modified some
comments a bit as well as the commit messages.
Thank you!
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"Cuando mañana llegue pelearemos segun lo que mañana exija" (Mowgli)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@alvh.no-ip.org, jian.universality@gmail.com, sulamul@gmail.com, tndrwang@gmail.com, ah@cybertec.at
Subject: Re: Foreign key validation failure in 18beta1
In-Reply-To: <202506051701.wjgu2jhnksb5@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox