Re: simplifying foreign key/RI checks

From: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Zhihong Yu <zyu(at)yugabyte(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: simplifying foreign key/RI checks
Date: 2021-12-20 04:59:59
Message-ID: CADkLM=f-b5TfQY2A-2R8se9uAHaGenx5qQf9icO1RcOtfEmNuQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
>
>
> I wasn't able to make much inroads into how we might be able to get
> rid of the DETACH-related partition descriptor hacks, the item (3),
> though I made some progress on items (1) and (2).
>
> For (1), the attached 0001 patch adds a new isolation suite
> fk-snapshot.spec to exercise snapshot behaviors in the cases where we
> no longer go through SPI. It helped find some problems with the
> snapshot handling in the earlier versions of the patch, mainly with
> partitioned PK tables. It also contains a test along the lines of the
> example you showed upthread, which shows that the partition descriptor
> hack requiring ActiveSnapshot to be set results in wrong results.
> Patch includes the buggy output for that test case and marked as such
> in a comment above the test.
>
> In updated 0002, I fixed things such that the snapshot-setting
> required by the partition descriptor hack is independent of
> snapshot-setting of the RI query such that it no longer causes the PK
> index scan to return rows that the RI query mustn't see. That fixes
> the visibility bug illustrated in your example, and as mentioned, also
> exercised in the new test suite.
>
> I also moved find_leaf_pk_rel() into execPartition.c with a new name
> and a new set of parameters.
>
> --
> Amit Langote
> EDB: http://www.enterprisedb.com

Sorry for the delay. This patch no longer applies, it has some conflict
with d6f96ed94e73052f99a2e545ed17a8b2fdc1fb8a

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Nancarrow 2021-12-20 05:10:23 Re: PublicationActions - use bit flags.
Previous Message Peter Smith 2021-12-20 04:53:00 Re: row filtering for logical replication