Re: Foreign key isolation tests

Paul A Jungwirth <pj@illuminatedcomputing.com>

From: Paul A Jungwirth <pj@illuminatedcomputing.com>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Rustam ALLAKOV <rustamallakov@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2025-07-18T23:25:54Z
Lists: pgsql-hackers

Attachments

On Fri, Jul 18, 2025 at 3:29 AM Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
> I agree that additional testing in this area is valuable. Patch 0001
> looks reasonable to me, on a quick read-through. In patch 0002, I
> think it would be valuable to also test updating the parent row to
> time periods consistent and not consistent with the insert, to confirm
> that that behaves correctly.

Thanks for taking a look! Here are new patches with those extra tests.
There are extensive regress tests already, so I just tested the same
concurrency pattern. I think the results are okay. I do get a
can't-serialize exception for a couple valid changes under REPEATABLE
READ and SERIALIZE, but I think they are expected and not a bug. (I
think you would see the same thing outside of FKs.)

-- 
Paul              ~{:-)
pj@illuminatedcomputing.com

Commits

  1. Improve comment about snapshot macros

  2. Add test for temporal referential integrity

  3. Fill testing gap for possible referential integrity violation

  4. Simplify COALESCE() with one surviving argument.