Repair RI trigger visibility problems (this time for sure ;-)) per recent
Tom Lane <tgl@sss.pgh.pa.us>
Repair RI trigger visibility problems (this time for sure ;-)) per recent discussion on pgsql-hackers: in READ COMMITTED mode we just have to force a QuerySnapshot update in the trigger, but in SERIALIZABLE mode we have to run the scan under a current snapshot and then complain if any rows would be updated/deleted that are not visible in the transaction snapshot.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/heap/heapam.c | modified | +47 −10 |
| src/backend/commands/async.c | modified | +2 −2 |
| src/backend/executor/execMain.c | modified | +27 −16 |
| src/backend/executor/execUtils.c | modified | +2 −2 |
| src/backend/executor/nodeSubplan.c | modified | +2 −2 |
| src/backend/executor/nodeSubqueryscan.c | modified | +2 −2 |
| src/backend/executor/spi.c | modified | +16 −12 |
| src/backend/storage/ipc/sinval.c | modified | +5 −5 |
| src/backend/utils/adt/ri_triggers.c | modified | +44 −11 |
| src/backend/utils/time/tqual.c | modified | +50 −10 |
| src/include/access/heapam.h | modified | +3 −3 |
| src/include/executor/executor.h | modified | +2 −2 |
| src/include/executor/spi.h | modified | +3 −3 |
| src/include/nodes/execnodes.h | modified | +2 −2 |
| src/include/utils/tqual.h | modified | +3 −2 |