snapshot-self-not-now-v1.patch
application/octet-stream
Filename: snapshot-self-not-now-v1.patch
Type: application/octet-stream
Part: 1
Message:
getting rid of SnapshotNow
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
Series: patch v1
| File | + | − |
|---|---|---|
| contrib/pgrowlocks/pgrowlocks.c | 1 | 1 |
| contrib/pgstattuple/pgstattuple.c | 1 | 1 |
| src/backend/utils/adt/selfuncs.c | 2 | 2 |
diff --git a/contrib/pgrowlocks/pgrowlocks.c b/contrib/pgrowlocks/pgrowlocks.c
index 075d781..23ec02a 100644
--- a/contrib/pgrowlocks/pgrowlocks.c
+++ b/contrib/pgrowlocks/pgrowlocks.c
@@ -106,7 +106,7 @@ pgrowlocks(PG_FUNCTION_ARGS)
aclcheck_error(aclresult, ACL_KIND_CLASS,
RelationGetRelationName(rel));
- scan = heap_beginscan(rel, SnapshotNow, 0, NULL);
+ scan = heap_beginscan(rel, SnapshotSelf, 0, NULL);
mydata = palloc(sizeof(*mydata));
mydata->rel = rel;
mydata->scan = scan;
diff --git a/contrib/pgstattuple/pgstattuple.c b/contrib/pgstattuple/pgstattuple.c
index 7f41ec3..d2667db 100644
--- a/contrib/pgstattuple/pgstattuple.c
+++ b/contrib/pgstattuple/pgstattuple.c
@@ -296,7 +296,7 @@ pgstat_heap(Relation rel, FunctionCallInfo fcinfo)
/* must hold a buffer lock to call HeapTupleSatisfiesVisibility */
LockBuffer(scan->rs_cbuf, BUFFER_LOCK_SHARE);
- if (HeapTupleSatisfiesVisibility(tuple, SnapshotNow, scan->rs_cbuf))
+ if (HeapTupleSatisfiesVisibility(tuple, SnapshotSelf, scan->rs_cbuf))
{
stat.tuple_len += tuple->t_len;
stat.tuple_count++;
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index da66f34..649afa1 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -4991,7 +4991,7 @@ get_actual_variable_range(PlannerInfo *root, VariableStatData *vardata,
/* If min is requested ... */
if (min)
{
- index_scan = index_beginscan(heapRel, indexRel, SnapshotNow,
+ index_scan = index_beginscan(heapRel, indexRel, SnapshotSelf,
1, 0);
index_rescan(index_scan, scankeys, 1, NULL, 0);
@@ -5023,7 +5023,7 @@ get_actual_variable_range(PlannerInfo *root, VariableStatData *vardata,
/* If max is requested, and we didn't find the index is empty */
if (max && have_data)
{
- index_scan = index_beginscan(heapRel, indexRel, SnapshotNow,
+ index_scan = index_beginscan(heapRel, indexRel, SnapshotSelf,
1, 0);
index_rescan(index_scan, scankeys, 1, NULL, 0);