aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/sequence.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2019-01-21 10:32:19 -0800
committerAndres Freund <andres@anarazel.de>2019-01-21 10:51:37 -0800
commite0c4ec07284db817e1f8d9adfb3fffc952252db0 (patch)
treead56d635b246f6d4d0d7a17b2a4ac797d7227b62 /src/backend/commands/sequence.c
parent111944c5ee567f1c45bf0f1ecfdec682af467aa6 (diff)
downloadpostgresql-e0c4ec07284db817e1f8d9adfb3fffc952252db0.tar.gz
postgresql-e0c4ec07284db817e1f8d9adfb3fffc952252db0.zip
Replace uses of heap_open et al with the corresponding table_* function.
Author: Andres Freund Discussion: https://postgr.es/m/20190111000539.xbv7s6w7ilcvm7dp@alap3.anarazel.de
Diffstat (limited to 'src/backend/commands/sequence.c')
-rw-r--r--src/backend/commands/sequence.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c
index 5554e883d80..574b46a2812 100644
--- a/src/backend/commands/sequence.c
+++ b/src/backend/commands/sequence.c
@@ -217,7 +217,7 @@ DefineSequence(ParseState *pstate, CreateSeqStmt *seq)
seqoid = address.objectId;
Assert(seqoid != InvalidOid);
- rel = heap_open(seqoid, AccessExclusiveLock);
+ rel = table_open(seqoid, AccessExclusiveLock);
tupDesc = RelationGetDescr(rel);
/* now initialize the sequence's data */
@@ -228,10 +228,10 @@ DefineSequence(ParseState *pstate, CreateSeqStmt *seq)
if (owned_by)
process_owned_by(rel, owned_by, seq->for_identity);
- heap_close(rel, NoLock);
+ table_close(rel, NoLock);
/* fill in pg_sequence */
- rel = heap_open(SequenceRelationId, RowExclusiveLock);
+ rel = table_open(SequenceRelationId, RowExclusiveLock);
tupDesc = RelationGetDescr(rel);
memset(pgs_nulls, 0, sizeof(pgs_nulls));
@@ -249,7 +249,7 @@ DefineSequence(ParseState *pstate, CreateSeqStmt *seq)
CatalogTupleInsert(rel, tuple);
heap_freetuple(tuple);
- heap_close(rel, RowExclusiveLock);
+ table_close(rel, RowExclusiveLock);
return address;
}
@@ -446,7 +446,7 @@ AlterSequence(ParseState *pstate, AlterSeqStmt *stmt)
init_sequence(relid, &elm, &seqrel);
- rel = heap_open(SequenceRelationId, RowExclusiveLock);
+ rel = table_open(SequenceRelationId, RowExclusiveLock);
seqtuple = SearchSysCacheCopy1(SEQRELID,
ObjectIdGetDatum(relid));
if (!HeapTupleIsValid(seqtuple))
@@ -506,7 +506,7 @@ AlterSequence(ParseState *pstate, AlterSeqStmt *stmt)
ObjectAddressSet(address, RelationRelationId, relid);
- heap_close(rel, RowExclusiveLock);
+ table_close(rel, RowExclusiveLock);
relation_close(seqrel, NoLock);
return address;
@@ -518,7 +518,7 @@ DeleteSequenceTuple(Oid relid)
Relation rel;
HeapTuple tuple;
- rel = heap_open(SequenceRelationId, RowExclusiveLock);
+ rel = table_open(SequenceRelationId, RowExclusiveLock);
tuple = SearchSysCache1(SEQRELID, ObjectIdGetDatum(relid));
if (!HeapTupleIsValid(tuple))
@@ -527,7 +527,7 @@ DeleteSequenceTuple(Oid relid)
CatalogTupleDelete(rel, &tuple->t_self);
ReleaseSysCache(tuple);
- heap_close(rel, RowExclusiveLock);
+ table_close(rel, RowExclusiveLock);
}
/*