Use correct variable name in publicationcmds.c.
authorAmit Kapila <[email protected]>
Tue, 18 Mar 2025 08:36:51 +0000 (14:06 +0530)
committerAmit Kapila <[email protected]>
Tue, 18 Mar 2025 08:36:51 +0000 (14:06 +0530)
subid was used at few places for publicationid in publicationcmds.c/.h.

Author: vignesh C <[email protected]>
Reviewed-by: Ashutosh Bapat <[email protected]>
Discussion: https://postgr.es/m/CALDaNm1KqJ0VFfDJRPbfYi9Shz6LHFEE-Ckn+eqsePfKhebv9w@mail.gmail.com

src/backend/commands/publicationcmds.c
src/include/commands/publicationcmds.h

index 3091d36ce98e535b9b01722307cf5d729c5147fb..0b23d94c38e20d6b03282a3da66fe696e03be7b7 100644 (file)
@@ -2052,7 +2052,7 @@ AlterPublicationOwner_internal(Relation rel, HeapTuple tup, Oid newOwnerId)
 ObjectAddress
 AlterPublicationOwner(const char *name, Oid newOwnerId)
 {
-   Oid         subid;
+   Oid         pubid;
    HeapTuple   tup;
    Relation    rel;
    ObjectAddress address;
@@ -2068,11 +2068,11 @@ AlterPublicationOwner(const char *name, Oid newOwnerId)
                 errmsg("publication \"%s\" does not exist", name)));
 
    pubform = (Form_pg_publication) GETSTRUCT(tup);
-   subid = pubform->oid;
+   pubid = pubform->oid;
 
    AlterPublicationOwner_internal(rel, tup, newOwnerId);
 
-   ObjectAddressSet(address, PublicationRelationId, subid);
+   ObjectAddressSet(address, PublicationRelationId, pubid);
 
    heap_freetuple(tup);
 
@@ -2085,19 +2085,19 @@ AlterPublicationOwner(const char *name, Oid newOwnerId)
  * Change publication owner -- by OID
  */
 void
-AlterPublicationOwner_oid(Oid subid, Oid newOwnerId)
+AlterPublicationOwner_oid(Oid pubid, Oid newOwnerId)
 {
    HeapTuple   tup;
    Relation    rel;
 
    rel = table_open(PublicationRelationId, RowExclusiveLock);
 
-   tup = SearchSysCacheCopy1(PUBLICATIONOID, ObjectIdGetDatum(subid));
+   tup = SearchSysCacheCopy1(PUBLICATIONOID, ObjectIdGetDatum(pubid));
 
    if (!HeapTupleIsValid(tup))
        ereport(ERROR,
                (errcode(ERRCODE_UNDEFINED_OBJECT),
-                errmsg("publication with OID %u does not exist", subid)));
+                errmsg("publication with OID %u does not exist", pubid)));
 
    AlterPublicationOwner_internal(rel, tup, newOwnerId);
 
index e41df6db03896a8779d4bc36bbb12fd3a1f4d6b1..f90cf1ef896ee87aaf641cba34d2b4387906549a 100644 (file)
@@ -29,7 +29,7 @@ extern void RemovePublicationRelById(Oid proid);
 extern void RemovePublicationSchemaById(Oid psoid);
 
 extern ObjectAddress AlterPublicationOwner(const char *name, Oid newOwnerId);
-extern void AlterPublicationOwner_oid(Oid subid, Oid newOwnerId);
+extern void AlterPublicationOwner_oid(Oid pubid, Oid newOwnerId);
 extern void InvalidatePublicationRels(List *relids);
 extern bool pub_rf_contains_invalid_column(Oid pubid, Relation relation,
                                           List *ancestors, bool pubviaroot);