Re: Foreign key validation failure in 18beta1

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: Amul Sul <sulamul(at)gmail(dot)com>, Tender Wang <tndrwang(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Antonin Houska <ah(at)cybertec(dot)at>
Subject: Re: Foreign key validation failure in 18beta1
Date: 2025-06-05 17:01:06
Message-ID: 202506051701.wjgu2jhnksb5@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025-Jun-04, jian he wrote:

> On Tue, Jun 3, 2025 at 12:14 PM Amul Sul <sulamul(at)gmail(dot)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)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2025-06-05 17:05:28 Re: ABI Compliance Checker GSoC Project
Previous Message Tom Lane 2025-06-05 16:47:52 Re: postmaster uses more CPU in 18 beta1 with io_method=io_uring