Re: Allow NOT VALID foreign key constraints on partitioned tables.

From: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Amul Sul <sulamul(at)gmail(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Allow NOT VALID foreign key constraints on partitioned tables.
Date: 2025-01-21 21:06:14
Message-ID: 202501212106.2wbouzfk56mb@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Suppose I have a hierarchy like this

parent
|
child
/\
/ \
/ grandchild2
/
grandchild1

and I have a validated constraint on grandchild1 and an invalid
constraint on child. What happens if I add a constraint on parent? In
my understanding, it should not attempt to revalidate the constraint on
grandchild1, because it's known valid; but I don't think I see code that
would skip validation there. That is, QueueFKConstraintValidation does
its thing unconditionally (esp. recursing to children), which seems
wrong.

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"I am amazed at [the pgsql-sql] mailing list for the wonderful support, and
lack of hesitasion in answering a lost soul's question, I just wished the rest
of the mailing list could be like this." (Fotis)
https://postgr.es/m/200606261359.k5QDxE2p004593@auth-smtp.hol.gr

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2025-01-21 21:13:26 Re: Replace current implementations in crypt() and gen_salt() to OpenSSL
Previous Message Daniel Gustafsson 2025-01-21 21:05:09 Re: Replace current implementations in crypt() and gen_salt() to OpenSSL