mirror of
https://github.com/postgres/postgres.git
synced 2025-08-31 17:02:12 +03:00
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.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.60 2003/09/24 18:54:01 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/sinval.c,v 1.61 2003/10/01 21:30:52 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -330,10 +330,10 @@ GetSnapshotData(Snapshot snapshot, bool serializable)
|
||||
* lastBackend would be sufficient. But it seems better to do the
|
||||
* malloc while not holding the lock, so we can't look at lastBackend.
|
||||
*
|
||||
* if (snapshot->xip != NULL) no need to free and reallocate xip;
|
||||
*
|
||||
* We can reuse the old xip array, because MaxBackends does not change at
|
||||
* runtime.
|
||||
* This does open a possibility for avoiding repeated malloc/free:
|
||||
* since MaxBackends does not change at runtime, we can simply reuse
|
||||
* the previous xip array if any. (This relies on the fact that all
|
||||
* calls pass static SnapshotData structs.)
|
||||
*/
|
||||
if (snapshot->xip == NULL)
|
||||
{
|
||||
|
Reference in New Issue
Block a user