diff options
| author | Andres Freund | 2019-01-21 18:32:19 +0000 |
|---|---|---|
| committer | Andres Freund | 2019-01-21 18:51:37 +0000 |
| commit | e0c4ec07284db817e1f8d9adfb3fffc952252db0 (patch) | |
| tree | ad56d635b246f6d4d0d7a17b2a4ac797d7227b62 /src/backend/commands/publicationcmds.c | |
| parent | 111944c5ee567f1c45bf0f1ecfdec682af467aa6 (diff) | |
Replace uses of heap_open et al with the corresponding table_* function.
Author: Andres Freund
Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/backend/commands/publicationcmds.c')
| -rw-r--r-- | src/backend/commands/publicationcmds.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/backend/commands/publicationcmds.c b/src/backend/commands/publicationcmds.c index e431e58f0e6..eb9a093ea03 100644 --- a/src/backend/commands/publicationcmds.c +++ b/src/backend/commands/publicationcmds.c @@ -165,7 +165,7 @@ CreatePublication(CreatePublicationStmt *stmt) (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), (errmsg("must be superuser to create FOR ALL TABLES publication")))); - rel = heap_open(PublicationRelationId, RowExclusiveLock); + rel = table_open(PublicationRelationId, RowExclusiveLock); /* Check if name is used */ puboid = GetSysCacheOid1(PUBLICATIONNAME, Anum_pg_publication_oid, @@ -229,7 +229,7 @@ CreatePublication(CreatePublicationStmt *stmt) CloseTableList(rels); } - heap_close(rel, RowExclusiveLock); + table_close(rel, RowExclusiveLock); InvokeObjectPostCreateHook(PublicationRelationId, puboid, 0); @@ -377,8 +377,8 @@ AlterPublicationTables(AlterPublicationStmt *stmt, Relation rel, if (!found) { - Relation oldrel = heap_open(oldrelid, - ShareUpdateExclusiveLock); + Relation oldrel = table_open(oldrelid, + ShareUpdateExclusiveLock); delrels = lappend(delrels, oldrel); } @@ -412,7 +412,7 @@ AlterPublication(AlterPublicationStmt *stmt) HeapTuple tup; Form_pg_publication pubform; - rel = heap_open(PublicationRelationId, RowExclusiveLock); + rel = table_open(PublicationRelationId, RowExclusiveLock); tup = SearchSysCacheCopy1(PUBLICATIONNAME, CStringGetDatum(stmt->pubname)); @@ -437,7 +437,7 @@ AlterPublication(AlterPublicationStmt *stmt) /* Cleanup. */ heap_freetuple(tup); - heap_close(rel, RowExclusiveLock); + table_close(rel, RowExclusiveLock); } /* @@ -449,7 +449,7 @@ RemovePublicationById(Oid pubid) Relation rel; HeapTuple tup; - rel = heap_open(PublicationRelationId, RowExclusiveLock); + rel = table_open(PublicationRelationId, RowExclusiveLock); tup = SearchSysCache1(PUBLICATIONOID, ObjectIdGetDatum(pubid)); @@ -460,7 +460,7 @@ RemovePublicationById(Oid pubid) ReleaseSysCache(tup); - heap_close(rel, RowExclusiveLock); + table_close(rel, RowExclusiveLock); } /* @@ -473,7 +473,7 @@ RemovePublicationRelById(Oid proid) HeapTuple tup; Form_pg_publication_rel pubrel; - rel = heap_open(PublicationRelRelationId, RowExclusiveLock); + rel = table_open(PublicationRelRelationId, RowExclusiveLock); tup = SearchSysCache1(PUBLICATIONREL, ObjectIdGetDatum(proid)); @@ -490,7 +490,7 @@ RemovePublicationRelById(Oid proid) ReleaseSysCache(tup); - heap_close(rel, RowExclusiveLock); + table_close(rel, RowExclusiveLock); } /* @@ -517,7 +517,7 @@ OpenTableList(List *tables) /* Allow query cancel in case this takes a long time */ CHECK_FOR_INTERRUPTS(); - rel = heap_openrv(rv, ShareUpdateExclusiveLock); + rel = table_openrv(rv, ShareUpdateExclusiveLock); myrelid = RelationGetRelid(rel); /* @@ -529,7 +529,7 @@ OpenTableList(List *tables) */ if (list_member_oid(relids, myrelid)) { - heap_close(rel, ShareUpdateExclusiveLock); + table_close(rel, ShareUpdateExclusiveLock); continue; } @@ -560,7 +560,7 @@ OpenTableList(List *tables) continue; /* find_all_inheritors already got lock */ - rel = heap_open(childrelid, NoLock); + rel = table_open(childrelid, NoLock); rels = lappend(rels, rel); relids = lappend_oid(relids, childrelid); } @@ -584,7 +584,7 @@ CloseTableList(List *rels) { Relation rel = (Relation) lfirst(lc); - heap_close(rel, NoLock); + table_close(rel, NoLock); } } @@ -718,7 +718,7 @@ AlterPublicationOwner(const char *name, Oid newOwnerId) ObjectAddress address; Form_pg_publication pubform; - rel = heap_open(PublicationRelationId, RowExclusiveLock); + rel = table_open(PublicationRelationId, RowExclusiveLock); tup = SearchSysCacheCopy1(PUBLICATIONNAME, CStringGetDatum(name)); @@ -736,7 +736,7 @@ AlterPublicationOwner(const char *name, Oid newOwnerId) heap_freetuple(tup); - heap_close(rel, RowExclusiveLock); + table_close(rel, RowExclusiveLock); return address; } @@ -750,7 +750,7 @@ AlterPublicationOwner_oid(Oid subid, Oid newOwnerId) HeapTuple tup; Relation rel; - rel = heap_open(PublicationRelationId, RowExclusiveLock); + rel = table_open(PublicationRelationId, RowExclusiveLock); tup = SearchSysCacheCopy1(PUBLICATIONOID, ObjectIdGetDatum(subid)); @@ -763,5 +763,5 @@ AlterPublicationOwner_oid(Oid subid, Oid newOwnerId) heap_freetuple(tup); - heap_close(rel, RowExclusiveLock); + table_close(rel, RowExclusiveLock); } |
