mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
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
This commit is contained in:
@ -2052,7 +2052,7 @@ AlterPublicationOwner_internal(Relation rel, HeapTuple tup, Oid newOwnerId)
|
|||||||
ObjectAddress
|
ObjectAddress
|
||||||
AlterPublicationOwner(const char *name, Oid newOwnerId)
|
AlterPublicationOwner(const char *name, Oid newOwnerId)
|
||||||
{
|
{
|
||||||
Oid subid;
|
Oid pubid;
|
||||||
HeapTuple tup;
|
HeapTuple tup;
|
||||||
Relation rel;
|
Relation rel;
|
||||||
ObjectAddress address;
|
ObjectAddress address;
|
||||||
@ -2068,11 +2068,11 @@ AlterPublicationOwner(const char *name, Oid newOwnerId)
|
|||||||
errmsg("publication \"%s\" does not exist", name)));
|
errmsg("publication \"%s\" does not exist", name)));
|
||||||
|
|
||||||
pubform = (Form_pg_publication) GETSTRUCT(tup);
|
pubform = (Form_pg_publication) GETSTRUCT(tup);
|
||||||
subid = pubform->oid;
|
pubid = pubform->oid;
|
||||||
|
|
||||||
AlterPublicationOwner_internal(rel, tup, newOwnerId);
|
AlterPublicationOwner_internal(rel, tup, newOwnerId);
|
||||||
|
|
||||||
ObjectAddressSet(address, PublicationRelationId, subid);
|
ObjectAddressSet(address, PublicationRelationId, pubid);
|
||||||
|
|
||||||
heap_freetuple(tup);
|
heap_freetuple(tup);
|
||||||
|
|
||||||
@ -2085,19 +2085,19 @@ AlterPublicationOwner(const char *name, Oid newOwnerId)
|
|||||||
* Change publication owner -- by OID
|
* Change publication owner -- by OID
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
AlterPublicationOwner_oid(Oid subid, Oid newOwnerId)
|
AlterPublicationOwner_oid(Oid pubid, Oid newOwnerId)
|
||||||
{
|
{
|
||||||
HeapTuple tup;
|
HeapTuple tup;
|
||||||
Relation rel;
|
Relation rel;
|
||||||
|
|
||||||
rel = table_open(PublicationRelationId, RowExclusiveLock);
|
rel = table_open(PublicationRelationId, RowExclusiveLock);
|
||||||
|
|
||||||
tup = SearchSysCacheCopy1(PUBLICATIONOID, ObjectIdGetDatum(subid));
|
tup = SearchSysCacheCopy1(PUBLICATIONOID, ObjectIdGetDatum(pubid));
|
||||||
|
|
||||||
if (!HeapTupleIsValid(tup))
|
if (!HeapTupleIsValid(tup))
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_UNDEFINED_OBJECT),
|
(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);
|
AlterPublicationOwner_internal(rel, tup, newOwnerId);
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ extern void RemovePublicationRelById(Oid proid);
|
|||||||
extern void RemovePublicationSchemaById(Oid psoid);
|
extern void RemovePublicationSchemaById(Oid psoid);
|
||||||
|
|
||||||
extern ObjectAddress AlterPublicationOwner(const char *name, Oid newOwnerId);
|
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 void InvalidatePublicationRels(List *relids);
|
||||||
extern bool pub_rf_contains_invalid_column(Oid pubid, Relation relation,
|
extern bool pub_rf_contains_invalid_column(Oid pubid, Relation relation,
|
||||||
List *ancestors, bool pubviaroot);
|
List *ancestors, bool pubviaroot);
|
||||||
|
Reference in New Issue
Block a user