diff options
author | Robert Haas <rhaas@postgresql.org> | 2015-04-29 15:48:44 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2015-04-29 15:48:44 -0400 |
commit | 9b6a0ce5f060315f900de7b398d5197a2e42f2f2 (patch) | |
tree | c731c88d30c3347ec869dfd1f9e81fc331db3b5c /src/backend/utils/adt/enum.c | |
parent | ef3f9e642d2b2bba8933b4cff4039ce0d354ce08 (diff) | |
download | postgresql-9b6a0ce5f060315f900de7b398d5197a2e42f2f2.tar.gz postgresql-9b6a0ce5f060315f900de7b398d5197a2e42f2f2.zip |
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.
Diffstat (limited to 'src/backend/utils/adt/enum.c')
-rw-r--r-- | src/backend/utils/adt/enum.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/backend/utils/adt/enum.c b/src/backend/utils/adt/enum.c index 3446da31048..d5818a9751e 100644 --- a/src/backend/utils/adt/enum.c +++ b/src/backend/utils/adt/enum.c @@ -312,8 +312,8 @@ enum_endpoint(Oid enumtypoid, ScanDirection direction) /* * Find the first/last enum member using pg_enum_typid_sortorder_index. - * Note we must not use the syscache, and must use an MVCC snapshot here. - * See comments for RenumberEnumType in catalog/pg_enum.c for more info. + * Note we must not use the syscache. See comments for RenumberEnumType + * in catalog/pg_enum.c for more info. */ ScanKeyInit(&skey, Anum_pg_enum_enumtypid, @@ -322,8 +322,7 @@ enum_endpoint(Oid enumtypoid, ScanDirection direction) enum_rel = heap_open(EnumRelationId, AccessShareLock); enum_idx = index_open(EnumTypIdSortOrderIndexId, AccessShareLock); - enum_scan = systable_beginscan_ordered(enum_rel, enum_idx, - GetTransactionSnapshot(), + enum_scan = systable_beginscan_ordered(enum_rel, enum_idx, NULL, 1, &skey); enum_tuple = systable_getnext_ordered(enum_scan, direction); @@ -465,8 +464,8 @@ enum_range_internal(Oid enumtypoid, Oid lower, Oid upper) /* * Scan the enum members in order using pg_enum_typid_sortorder_index. - * Note we must not use the syscache, and must use an MVCC snapshot here. - * See comments for RenumberEnumType in catalog/pg_enum.c for more info. + * Note we must not use the syscache. See comments for RenumberEnumType + * in catalog/pg_enum.c for more info. */ ScanKeyInit(&skey, Anum_pg_enum_enumtypid, @@ -475,9 +474,7 @@ enum_range_internal(Oid enumtypoid, Oid lower, Oid upper) enum_rel = heap_open(EnumRelationId, AccessShareLock); enum_idx = index_open(EnumTypIdSortOrderIndexId, AccessShareLock); - enum_scan = systable_beginscan_ordered(enum_rel, enum_idx, - GetTransactionSnapshot(), - 1, &skey); + enum_scan = systable_beginscan_ordered(enum_rel, enum_idx, NULL, 1, &skey); max = 64; elems = (Datum *) palloc(max * sizeof(Datum)); |