diff options
Diffstat (limited to 'src/backend/tcop/utility.c')
-rw-r--r-- | src/backend/tcop/utility.c | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/backend/tcop/utility.c b/src/backend/tcop/utility.c index 14921013360..03062471774 100644 --- a/src/backend/tcop/utility.c +++ b/src/backend/tcop/utility.c @@ -44,9 +44,11 @@ #include "commands/portalcmds.h" #include "commands/prepare.h" #include "commands/proclang.h" +#include "commands/publicationcmds.h" #include "commands/schemacmds.h" #include "commands/seclabel.h" #include "commands/sequence.h" +#include "commands/subscriptioncmds.h" #include "commands/tablecmds.h" #include "commands/tablespace.h" #include "commands/trigger.h" @@ -209,6 +211,11 @@ check_xact_readonly(Node *parsetree) case T_CreateForeignTableStmt: case T_ImportForeignSchemaStmt: case T_SecLabelStmt: + case T_CreatePublicationStmt: + case T_AlterPublicationStmt: + case T_CreateSubscriptionStmt: + case T_AlterSubscriptionStmt: + case T_DropSubscriptionStmt: PreventCommandIfReadOnly(CreateCommandTag(parsetree)); PreventCommandIfParallelMode(CreateCommandTag(parsetree)); break; @@ -1578,6 +1585,33 @@ ProcessUtilitySlow(ParseState *pstate, address = CreateAccessMethod((CreateAmStmt *) parsetree); break; + case T_CreatePublicationStmt: + address = CreatePublication((CreatePublicationStmt *) parsetree); + break; + + case T_AlterPublicationStmt: + AlterPublication((AlterPublicationStmt *) parsetree); + /* + * AlterPublication calls EventTriggerCollectSimpleCommand + * directly + */ + commandCollected = true; + break; + + case T_CreateSubscriptionStmt: + address = CreateSubscription((CreateSubscriptionStmt *) parsetree); + break; + + case T_AlterSubscriptionStmt: + address = AlterSubscription((AlterSubscriptionStmt *) parsetree); + break; + + case T_DropSubscriptionStmt: + DropSubscription((DropSubscriptionStmt *) parsetree); + /* no commands stashed for DROP */ + commandCollected = true; + break; + default: elog(ERROR, "unrecognized node type: %d", (int) nodeTag(parsetree)); @@ -1941,6 +1975,12 @@ AlterObjectTypeCommandTag(ObjectType objtype) case OBJECT_MATVIEW: tag = "ALTER MATERIALIZED VIEW"; break; + case OBJECT_PUBLICATION: + tag = "ALTER PUBLICATION"; + break; + case OBJECT_SUBSCRIPTION: + tag = "ALTER SUBSCRIPTION"; + break; default: tag = "???"; break; @@ -2232,6 +2272,9 @@ CreateCommandTag(Node *parsetree) case OBJECT_ACCESS_METHOD: tag = "DROP ACCESS METHOD"; break; + case OBJECT_PUBLICATION: + tag = "DROP PUBLICATION"; + break; default: tag = "???"; } @@ -2602,6 +2645,26 @@ CreateCommandTag(Node *parsetree) tag = "CREATE ACCESS METHOD"; break; + case T_CreatePublicationStmt: + tag = "CREATE PUBLICATION"; + break; + + case T_AlterPublicationStmt: + tag = "ALTER PUBLICATION"; + break; + + case T_CreateSubscriptionStmt: + tag = "CREATE SUBSCRIPTION"; + break; + + case T_AlterSubscriptionStmt: + tag = "ALTER SUBSCRIPTION"; + break; + + case T_DropSubscriptionStmt: + tag = "DROP SUBSCRIPTION"; + break; + case T_PrepareStmt: tag = "PREPARE"; break; @@ -3166,6 +3229,26 @@ GetCommandLogLevel(Node *parsetree) lev = LOGSTMT_DDL; break; + case T_CreatePublicationStmt: + lev = LOGSTMT_DDL; + break; + + case T_AlterPublicationStmt: + lev = LOGSTMT_DDL; + break; + + case T_CreateSubscriptionStmt: + lev = LOGSTMT_DDL; + break; + + case T_AlterSubscriptionStmt: + lev = LOGSTMT_DDL; + break; + + case T_DropSubscriptionStmt: + lev = LOGSTMT_DDL; + break; + /* already-planned queries */ case T_PlannedStmt: { |