summaryrefslogtreecommitdiff
path: root/src/include/utils/tqual.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-09-13 20:10:13 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-09-13 20:10:13 +0000
commitb2c4071299e02ed96d48d3c8e776de2fab36f88c (patch)
treeff0db14826870f1c3fe46d94ea3a1e1697c658a7 /src/include/utils/tqual.h
parentd69528881ab72eac5a9f154f23dbf549789c264d (diff)
downloadpostgresql-b2c4071299e02ed96d48d3c8e776de2fab36f88c.tar.gz
Redesign query-snapshot timing so that volatile functions in READ COMMITTED
mode see a fresh snapshot for each command in the function, rather than using the latest interactive command's snapshot. Also, suppress fresh snapshots as well as CommandCounterIncrement inside STABLE and IMMUTABLE functions, instead using the snapshot taken for the most closely nested regular query. (This behavior is only sane for read-only functions, so the patch also enforces that such functions contain only SELECT commands.) As per my proposal of 6-Sep-2004; I note that I floated essentially the same proposal on 19-Jun-2002, but that discussion tailed off without any action. Since 8.0 seems like the right place to be taking possibly nontrivial backwards compatibility hits, let's get it done now.
Diffstat (limited to 'src/include/utils/tqual.h')
-rw-r--r--src/include/utils/tqual.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/include/utils/tqual.h b/src/include/utils/tqual.h
index 627bcaf75a..1e7bb61733 100644
--- a/src/include/utils/tqual.h
+++ b/src/include/utils/tqual.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/tqual.h,v 1.51 2004/09/11 18:28:34 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/utils/tqual.h,v 1.52 2004/09/13 20:08:35 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -54,8 +54,10 @@ typedef SnapshotData *Snapshot;
#define SnapshotToast ((Snapshot) 0x4)
extern DLLIMPORT Snapshot SnapshotDirty;
-extern DLLIMPORT Snapshot QuerySnapshot;
+
extern DLLIMPORT Snapshot SerializableSnapshot;
+extern DLLIMPORT Snapshot LatestSnapshot;
+extern DLLIMPORT Snapshot ActiveSnapshot;
extern TransactionId RecentXmin;
extern TransactionId RecentGlobalXmin;
@@ -121,10 +123,13 @@ extern int HeapTupleSatisfiesUpdate(HeapTupleHeader tuple,
extern HTSV_Result HeapTupleSatisfiesVacuum(HeapTupleHeader tuple,
TransactionId OldestXmin);
-extern Snapshot GetSnapshotData(Snapshot snapshot, bool serializable);
-extern void SetQuerySnapshot(void);
-extern Snapshot CopyQuerySnapshot(void);
-extern Snapshot CopyCurrentSnapshot(void);
+extern Snapshot GetTransactionSnapshot(void);
+extern Snapshot GetLatestSnapshot(void);
+extern Snapshot CopySnapshot(Snapshot snapshot);
+extern void FreeSnapshot(Snapshot snapshot);
extern void FreeXactSnapshot(void);
+/* in sinval.c; declared here to avoid including tqual.h in sinval.h: */
+extern Snapshot GetSnapshotData(Snapshot snapshot, bool serializable);
+
#endif /* TQUAL_H */