Re: Foreign key validation failure in 18beta1
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: jian he <jian.universality@gmail.com>
Cc: Amul Sul <sulamul@gmail.com>, Tender Wang <tndrwang@gmail.com>, pgsql-hackers@lists.postgresql.org, Antonin Houska <ah@cybertec.at>
Date: 2025-06-05T17:01:06Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Avoid bogus scans of partitions when marking FKs enforced
- e6f98d8848f1 18.0 landed
-
Avoid bogus scans of partitions when validating FKs to partitioned tables
- cc733ed164c5 18.0 landed
-
Allow NOT VALID foreign key constraints on partitioned tables
- b663b9436e75 18.0 cited
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)