Skip to content

Commit 01e27aa

Browse files
author
Amit Kapila
committed
Use correct variable name in publicationcmds.c.
subid was used at few places for publicationid in publicationcmds.c/.h. Author: vignesh C <vignesh21@gmail.com> Reviewed-by: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> Discussion: https://postgr.es/m/CALDaNm1KqJ0VFfDJRPbfYi9Shz6LHFEE-Ckn+eqsePfKhebv9w@mail.gmail.com
1 parent c462b05 commit 01e27aa

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/backend/commands/publicationcmds.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,7 +2052,7 @@ AlterPublicationOwner_internal(Relation rel, HeapTuple tup, Oid newOwnerId)
20522052
ObjectAddress
20532053
AlterPublicationOwner(const char *name, Oid newOwnerId)
20542054
{
2055-
Oid subid;
2055+
Oid pubid;
20562056
HeapTuple tup;
20572057
Relation rel;
20582058
ObjectAddress address;
@@ -2068,11 +2068,11 @@ AlterPublicationOwner(const char *name, Oid newOwnerId)
20682068
errmsg("publication \"%s\" does not exist", name)));
20692069

20702070
pubform = (Form_pg_publication) GETSTRUCT(tup);
2071-
subid = pubform->oid;
2071+
pubid = pubform->oid;
20722072

20732073
AlterPublicationOwner_internal(rel, tup, newOwnerId);
20742074

2075-
ObjectAddressSet(address, PublicationRelationId, subid);
2075+
ObjectAddressSet(address, PublicationRelationId, pubid);
20762076

20772077
heap_freetuple(tup);
20782078

@@ -2085,19 +2085,19 @@ AlterPublicationOwner(const char *name, Oid newOwnerId)
20852085
* Change publication owner -- by OID
20862086
*/
20872087
void
2088-
AlterPublicationOwner_oid(Oid subid, Oid newOwnerId)
2088+
AlterPublicationOwner_oid(Oid pubid, Oid newOwnerId)
20892089
{
20902090
HeapTuple tup;
20912091
Relation rel;
20922092

20932093
rel = table_open(PublicationRelationId, RowExclusiveLock);
20942094

2095-
tup = SearchSysCacheCopy1(PUBLICATIONOID, ObjectIdGetDatum(subid));
2095+
tup = SearchSysCacheCopy1(PUBLICATIONOID, ObjectIdGetDatum(pubid));
20962096

20972097
if (!HeapTupleIsValid(tup))
20982098
ereport(ERROR,
20992099
(errcode(ERRCODE_UNDEFINED_OBJECT),
2100-
errmsg("publication with OID %u does not exist", subid)));
2100+
errmsg("publication with OID %u does not exist", pubid)));
21012101

21022102
AlterPublicationOwner_internal(rel, tup, newOwnerId);
21032103

src/include/commands/publicationcmds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ extern void RemovePublicationRelById(Oid proid);
2929
extern void RemovePublicationSchemaById(Oid psoid);
3030

3131
extern ObjectAddress AlterPublicationOwner(const char *name, Oid newOwnerId);
32-
extern void AlterPublicationOwner_oid(Oid subid, Oid newOwnerId);
32+
extern void AlterPublicationOwner_oid(Oid pubid, Oid newOwnerId);
3333
extern void InvalidatePublicationRels(List *relids);
3434
extern bool pub_rf_contains_invalid_column(Oid pubid, Relation relation,
3535
List *ancestors, bool pubviaroot);

0 commit comments

Comments
 (0)