diff --git a/src/backend/distributed/executor/multi_utility.c b/src/backend/distributed/executor/multi_utility.c index 459483604..a9a50f6cd 100644 --- a/src/backend/distributed/executor/multi_utility.c +++ b/src/backend/distributed/executor/multi_utility.c @@ -3813,6 +3813,8 @@ ProcessDropTableStmt(DropStmt *dropTableStatement) continue; } + EnsureCoordinator(); + partitionList = PartitionList(relationId); if (list_length(partitionList) == 0) { diff --git a/src/test/regress/expected/multi_mx_partitioning.out b/src/test/regress/expected/multi_mx_partitioning.out index 0eb727585..3e91311fb 100644 --- a/src/test/regress/expected/multi_mx_partitioning.out +++ b/src/test/regress/expected/multi_mx_partitioning.out @@ -241,6 +241,10 @@ SELECT inhrelid::regclass FROM pg_inherits WHERE inhparent = 'partitioning_test' partitioning_test_2013 (4 rows) +-- make sure DROPping from worker node is not allowed +DROP TABLE partitioning_test; +ERROR: operation is not allowed on this node +HINT: Connect to the coordinator and run it again. \c - - - :master_port -- make sure we can repeatedly call start_metadata_sync_to_node SELECT start_metadata_sync_to_node('localhost', :worker_1_port); diff --git a/src/test/regress/expected/multi_mx_partitioning_0.out b/src/test/regress/expected/multi_mx_partitioning_0.out index d92f53d89..f39462ead 100644 --- a/src/test/regress/expected/multi_mx_partitioning_0.out +++ b/src/test/regress/expected/multi_mx_partitioning_0.out @@ -205,6 +205,9 @@ SELECT inhrelid::regclass FROM pg_inherits WHERE inhparent = 'partitioning_test' ERROR: relation "partitioning_test" does not exist LINE 1: ...elid::regclass FROM pg_inherits WHERE inhparent = 'partition... ^ +-- make sure DROPping from worker node is not allowed +DROP TABLE partitioning_test; +ERROR: table "partitioning_test" does not exist \c - - - :master_port -- make sure we can repeatedly call start_metadata_sync_to_node SELECT start_metadata_sync_to_node('localhost', :worker_1_port); diff --git a/src/test/regress/sql/multi_mx_partitioning.sql b/src/test/regress/sql/multi_mx_partitioning.sql index b05fbf309..ba3dd3a32 100644 --- a/src/test/regress/sql/multi_mx_partitioning.sql +++ b/src/test/regress/sql/multi_mx_partitioning.sql @@ -156,6 +156,9 @@ ALTER TABLE partitioning_test DETACH PARTITION partitioning_test_2009; SELECT inhrelid::regclass FROM pg_inherits WHERE inhparent = 'partitioning_test'::regclass; +-- make sure DROPping from worker node is not allowed +DROP TABLE partitioning_test; + \c - - - :master_port -- make sure we can repeatedly call start_metadata_sync_to_node