summaryrefslogtreecommitdiff
path: root/src/backend/commands/variable.c
diff options
context:
space:
mode:
authorAlvaro Herrera2008-05-12 20:02:02 +0000
committerAlvaro Herrera2008-05-12 20:02:02 +0000
commit9ba01a2950979fc152657a9255875c07740f8315 (patch)
tree35970fba35b95c750bd6251865d87f04c55b42b0 /src/backend/commands/variable.c
parent30bfe069b82c5a04fb69add1aa9654df9f5f72fa (diff)
Improve snapshot manager by keeping explicit track of snapshots.
There are two ways to track a snapshot: there's the "registered" list, which is used for arbitrary long-lived snapshots; and there's the "active stack", which is used for the snapshot that is considered "active" at any time. This also allows users of snapshots to stop worrying about snapshot memory allocation and freeing, and about using PG_TRY blocks around ActiveSnapshot assignment. This is all done automatically now. As a consequence, this allows us to reset MyProc->xmin when there are no more snapshots registered in the current backend, reducing the impact that long-running transactions have on VACUUM.
Diffstat (limited to 'src/backend/commands/variable.c')
-rw-r--r--src/backend/commands/variable.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/commands/variable.c b/src/backend/commands/variable.c
index 5769398632..dbe2172f85 100644
--- a/src/backend/commands/variable.c
+++ b/src/backend/commands/variable.c
@@ -550,7 +550,7 @@ show_log_timezone(void)
const char *
assign_XactIsoLevel(const char *value, bool doit, GucSource source)
{
- if (SerializableSnapshot != NULL)
+ if (FirstSnapshotSet)
{
ereport(GUC_complaint_elevel(source),
(errcode(ERRCODE_ACTIVE_SQL_TRANSACTION),