pgsql: Add test for temporal referential integrity

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add test for temporal referential integrity
Date: 2025-09-11 17:54:35
Message-ID: E1uwlVC-000Dgx-1r@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add test for temporal referential integrity

This commit adds an isolation test showing that temporal foreign keys do
not permit referential integrity violations under concurrency, like
fk-snapshot-2. You can show that the test fails by passing false for
detectNewRows to ri_PerformCheck in ri_restrict.

Author: Paul Jungwirth <pj(at)illuminatedcomputing(dot)com>
Reviewed-by: Rustam ALLAKOV <rustamallakov(at)gmail(dot)com>
Reviewed-by: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Reviewed-by: Robert Haas <robertmhaas(at)gmail(dot)com>
Discussion: https://postgr.es/m/CA+renyUp=xja80rBaB6NpY3RRdi750y046x28bo_xg29zKY72Q@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e8cec3d1791c140398454aa561cf51659dd8243d

Modified Files
--------------
src/test/isolation/expected/fk-snapshot-3.out | 213 ++++++++++++++++++++++++++
src/test/isolation/isolation_schedule | 1 +
src/test/isolation/specs/fk-snapshot-3.spec | 82 ++++++++++
3 files changed, 296 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2025-09-11 21:12:26 pgsql: Report the correct is_temporary flag for column defaults.
Previous Message Álvaro Herrera 2025-09-11 16:12:14 pgsql: Fill testing gap for possible referential integrity violation