Re: Foreign key validation failure in 18beta1
amul sul <sulamul@gmail.com>
From: Amul Sul <sulamul@gmail.com>
To: jian he <jian.universality@gmail.com>
Cc: Tender Wang <tndrwang@gmail.com>,
Alvaro Herrera <alvherre@alvh.no-ip.org>, pgsql-hackers@lists.postgresql.org, Antonin Houska <ah@cybertec.at>
Date: 2025-06-02T03:26:27Z
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
Attachments
- v5-0001-Skip-adding-action-based-foreign-key-constraints-.patch (application/x-patch) patch v5-0001
On Sun, Jun 1, 2025 at 6:05 PM jian he <jian.universality@gmail.com> wrote:
>
> On Fri, May 30, 2025 at 6:32 PM Amul Sul <sulamul@gmail.com> wrote:
> >
[...]
>
> + * Note that validation should be performed against the referencing
> + * root table only, not its child partitions. See
> + * QueueFKConstraintValidation() for more details.
> */
> if (rel->rd_rel->relkind == RELKIND_RELATION &&
> currcon->confrelid == pkrelid)
> {
> AlteredTableInfo *tab;
> NewConstraint *newcon;
> newcon = (NewConstraint *) palloc0(sizeof(NewConstraint));
> ....
> }
>
> in the comments "referencing" should be "referenced"?
>
Yes, fixed in the attached version.
> other than that, it looks good.
>
Thanks for the review.
Regards,
Amul