Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9b6a0ce

Browse files
committed
Remove enum-related special cases for catalog scans.
When this code was written, catalog scans were normally performed using SnapshotNow, making special handling necessary here. Now, however, all catalog scans use MVCC snapshots, so we can change these cases to look more like what we do for catalog scans elsewhere in the code. Per discussion with Tom Lane and a reminder from Bruce Momjian.
1 parent ef3f9e6 commit 9b6a0ce

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/backend/utils/adt/enum.c

+6-9
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ enum_endpoint(Oid enumtypoid, ScanDirection direction)
312312

313313
/*
314314
* Find the first/last enum member using pg_enum_typid_sortorder_index.
315-
* Note we must not use the syscache, and must use an MVCC snapshot here.
316-
* See comments for RenumberEnumType in catalog/pg_enum.c for more info.
315+
* Note we must not use the syscache. See comments for RenumberEnumType
316+
* in catalog/pg_enum.c for more info.
317317
*/
318318
ScanKeyInit(&skey,
319319
Anum_pg_enum_enumtypid,
@@ -322,8 +322,7 @@ enum_endpoint(Oid enumtypoid, ScanDirection direction)
322322

323323
enum_rel = heap_open(EnumRelationId, AccessShareLock);
324324
enum_idx = index_open(EnumTypIdSortOrderIndexId, AccessShareLock);
325-
enum_scan = systable_beginscan_ordered(enum_rel, enum_idx,
326-
GetTransactionSnapshot(),
325+
enum_scan = systable_beginscan_ordered(enum_rel, enum_idx, NULL,
327326
1, &skey);
328327

329328
enum_tuple = systable_getnext_ordered(enum_scan, direction);
@@ -465,8 +464,8 @@ enum_range_internal(Oid enumtypoid, Oid lower, Oid upper)
465464

466465
/*
467466
* Scan the enum members in order using pg_enum_typid_sortorder_index.
468-
* Note we must not use the syscache, and must use an MVCC snapshot here.
469-
* See comments for RenumberEnumType in catalog/pg_enum.c for more info.
467+
* Note we must not use the syscache. See comments for RenumberEnumType
468+
* in catalog/pg_enum.c for more info.
470469
*/
471470
ScanKeyInit(&skey,
472471
Anum_pg_enum_enumtypid,
@@ -475,9 +474,7 @@ enum_range_internal(Oid enumtypoid, Oid lower, Oid upper)
475474

476475
enum_rel = heap_open(EnumRelationId, AccessShareLock);
477476
enum_idx = index_open(EnumTypIdSortOrderIndexId, AccessShareLock);
478-
enum_scan = systable_beginscan_ordered(enum_rel, enum_idx,
479-
GetTransactionSnapshot(),
480-
1, &skey);
477+
enum_scan = systable_beginscan_ordered(enum_rel, enum_idx, NULL, 1, &skey);
481478

482479
max = 64;
483480
elems = (Datum *) palloc(max * sizeof(Datum));

0 commit comments

Comments
 (0)