Foreign key isolation tests

From: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Foreign key isolation tests
Date: 2025-05-16 21:57:07
Message-ID: CA+renyUp=xja80rBaB6NpY3RRdi750y046x28bo_xg29zKY72Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Here are a couple new isolation tests for foreign keys, based on
feedback from the Advanced Patch Review session at PGConf.dev.

The goal is to show that temporal foreign keys do not violate
referential integrity under concurrency. Non-temporal foreign keys use
a crosscheck snapshot to avoid this. Temporal foreign keys do the
same, but this test gives us more assurance.

I noticed that traditional foreign keys didn't have a test either, at
least for the case we discussed: one transaction INSERTS a referencing
row, while the other DELETEs the referenced row. So I have two patches
here: one adding tests for the traditional case; another, the temporal
case.

There is a final patch improving the comment for some snapshot macros.
While fixing a typo I thought I could improve their clarity a bit as
well.

Yours,

--
Paul ~{:-)
pj(at)illuminatedcomputing(dot)com

Attachment Content-Type Size
v1-0003-Improve-comment-about-snapshot-macros.patch application/octet-stream 1.3 KB
v1-0001-Fill-testing-gap-for-possible-referential-integri.patch application/octet-stream 4.5 KB
v1-0002-Add-test-for-temporal-referential-integrity.patch application/octet-stream 3.6 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Nico Williams 2025-05-16 22:06:49 Re: Should we optimize the `ORDER BY random() LIMIT x` case?
Previous Message Nico Williams 2025-05-16 21:53:29 Re: Should we optimize the `ORDER BY random() LIMIT x` case?