summaryrefslogtreecommitdiff
path: root/src/backend/storage/ipc/sinval.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-10-01 21:30:53 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-10-01 21:30:53 +0000
commit55d85f42a891a812a9bbd69ebe530651a2f31624 (patch)
treecc2cb842242c7f683b73f6ac297a9939eb031976 /src/backend/storage/ipc/sinval.c
parent6099bc03f34b02fd5cf99f4187c9c6c189cd3c66 (diff)
downloadpostgresql-55d85f42a891a812a9bbd69ebe530651a2f31624.tar.gz
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.
Diffstat (limited to 'src/backend/storage/ipc/sinval.c')
-rw-r--r--src/backend/storage/ipc/sinval.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/storage/ipc/sinval.c b/src/backend/storage/ipc/sinval.c
index 366a606684..19a9093f87 100644
--- a/src/backend/storage/ipc/sinval.c
+++ b/src/backend/storage/ipc/sinval.c
@@ -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)
{