aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache/relcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/cache/relcache.c')
-rw-r--r--src/backend/utils/cache/relcache.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 76f41dbe36c..782af9aeed2 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -313,7 +313,7 @@ ScanPgRelation(Oid targetRelId, bool indexOK, bool force_non_historic)
Relation pg_class_desc;
SysScanDesc pg_class_scan;
ScanKeyData key[1];
- Snapshot snapshot;
+ Snapshot snapshot = NULL;
/*
* If something goes wrong during backend startup, we might find ourselves
@@ -343,12 +343,12 @@ ScanPgRelation(Oid targetRelId, bool indexOK, bool force_non_historic)
/*
* The caller might need a tuple that's newer than the one the historic
* snapshot; currently the only case requiring to do so is looking up the
- * relfilenode of non mapped system relations during decoding.
+ * relfilenode of non mapped system relations during decoding. That
+ * snapshot cant't change in the midst of a relcache build, so there's no
+ * need to register the snapshot.
*/
if (force_non_historic)
snapshot = GetNonHistoricCatalogSnapshot(RelationRelationId);
- else
- snapshot = GetCatalogSnapshot(RelationRelationId);
pg_class_scan = systable_beginscan(pg_class_desc, ClassOidIndexId,
indexOK && criticalRelcachesBuilt,