diff options
author | Kevin Grittner <kgrittn@postgresql.org> | 2016-04-08 14:36:30 -0500 |
---|---|---|
committer | Kevin Grittner <kgrittn@postgresql.org> | 2016-04-08 14:36:30 -0500 |
commit | 848ef42bb8c7909c9d7baa38178d4a209906e7c1 (patch) | |
tree | e15250d8dfd8f46b15e3ecfddfcad09799cc3866 /src/backend/access/gist/gistget.c | |
parent | 8b65cf4c5edabdcae45ceaef7b9ac236879aae50 (diff) | |
download | postgresql-848ef42bb8c7909c9d7baa38178d4a209906e7c1.tar.gz postgresql-848ef42bb8c7909c9d7baa38178d4a209906e7c1.zip |
Add the "snapshot too old" feature
This feature is controlled by a new old_snapshot_threshold GUC. A
value of -1 disables the feature, and that is the default. The
value of 0 is just intended for testing. Above that it is the
number of minutes a snapshot can reach before pruning and vacuum
are allowed to remove dead tuples which the snapshot would
otherwise protect. The xmin associated with a transaction ID does
still protect dead tuples. A connection which is using an "old"
snapshot does not get an error unless it accesses a page modified
recently enough that it might not be able to produce accurate
results.
This is similar to the Oracle feature, and we use the same SQLSTATE
and error message for compatibility.
Diffstat (limited to 'src/backend/access/gist/gistget.c')
-rw-r--r-- | src/backend/access/gist/gistget.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/access/gist/gistget.c b/src/backend/access/gist/gistget.c index 13a039947ba..24af868466d 100644 --- a/src/backend/access/gist/gistget.c +++ b/src/backend/access/gist/gistget.c @@ -336,7 +336,7 @@ gistScanPage(IndexScanDesc scan, GISTSearchItem *pageItem, double *myDistances, buffer = ReadBuffer(scan->indexRelation, pageItem->blkno); LockBuffer(buffer, GIST_SHARE); gistcheckpage(scan->indexRelation, buffer); - page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST); + page = BufferGetPage(buffer, scan->xs_snapshot, r, BGP_TEST_FOR_OLD_SNAPSHOT); opaque = GistPageGetOpaque(page); /* |