@@ -503,12 +503,12 @@ AlterPublicationTables(AlterPublicationStmt *stmt, HeapTuple tup,
503
503
* possible that user has not specified any tables in which case we need
504
504
* to remove all the existing tables.
505
505
*/
506
- if (!tables && stmt -> action != DEFELEM_SET )
506
+ if (!tables && stmt -> action != AP_SetObjects )
507
507
return ;
508
508
509
509
rels = OpenTableList (tables );
510
510
511
- if (stmt -> action == DEFELEM_ADD )
511
+ if (stmt -> action == AP_AddObjects )
512
512
{
513
513
List * schemas = NIL ;
514
514
@@ -521,9 +521,9 @@ AlterPublicationTables(AlterPublicationStmt *stmt, HeapTuple tup,
521
521
PUBLICATIONOBJ_TABLE );
522
522
PublicationAddTables (pubid , rels , false, stmt );
523
523
}
524
- else if (stmt -> action == DEFELEM_DROP )
524
+ else if (stmt -> action == AP_DropObjects )
525
525
PublicationDropTables (pubid , rels , false);
526
- else /* DEFELEM_SET */
526
+ else /* AP_SetObjects */
527
527
{
528
528
List * oldrelids = GetPublicationRelations (pubid ,
529
529
PUBLICATION_PART_ROOT );
@@ -598,15 +598,15 @@ AlterPublicationSchemas(AlterPublicationStmt *stmt,
598
598
* possible that user has not specified any schemas in which case we need
599
599
* to remove all the existing schemas.
600
600
*/
601
- if (!schemaidlist && stmt -> action != DEFELEM_SET )
601
+ if (!schemaidlist && stmt -> action != AP_SetObjects )
602
602
return ;
603
603
604
604
/*
605
605
* Schema lock is held until the publication is altered to prevent
606
606
* concurrent schema deletion.
607
607
*/
608
608
LockSchemaList (schemaidlist );
609
- if (stmt -> action == DEFELEM_ADD )
609
+ if (stmt -> action == AP_AddObjects )
610
610
{
611
611
List * rels ;
612
612
List * reloids ;
@@ -620,9 +620,9 @@ AlterPublicationSchemas(AlterPublicationStmt *stmt,
620
620
CloseTableList (rels );
621
621
PublicationAddSchemas (pubform -> oid , schemaidlist , false, stmt );
622
622
}
623
- else if (stmt -> action == DEFELEM_DROP )
623
+ else if (stmt -> action == AP_DropObjects )
624
624
PublicationDropSchemas (pubform -> oid , schemaidlist , false);
625
- else /* DEFELEM_SET */
625
+ else /* AP_SetObjects */
626
626
{
627
627
List * oldschemaids = GetPublicationSchemas (pubform -> oid );
628
628
List * delschemas = NIL ;
@@ -657,7 +657,7 @@ CheckAlterPublication(AlterPublicationStmt *stmt, HeapTuple tup,
657
657
{
658
658
Form_pg_publication pubform = (Form_pg_publication ) GETSTRUCT (tup );
659
659
660
- if ((stmt -> action == DEFELEM_ADD || stmt -> action == DEFELEM_SET ) &&
660
+ if ((stmt -> action == AP_AddObjects || stmt -> action == AP_SetObjects ) &&
661
661
schemaidlist && !superuser ())
662
662
ereport (ERROR ,
663
663
(errcode (ERRCODE_INSUFFICIENT_PRIVILEGE ),
0 commit comments