mirror of https://github.com/citusdata/citus.git
Merge pull request #2088 from citusdata/fix-drop-partitioning-table-from-worker
Prevent DROPping partitioned tables from workerspull/2013/head
commit
3873d6858d
|
@ -3813,6 +3813,8 @@ ProcessDropTableStmt(DropStmt *dropTableStatement)
|
|||
continue;
|
||||
}
|
||||
|
||||
EnsureCoordinator();
|
||||
|
||||
partitionList = PartitionList(relationId);
|
||||
if (list_length(partitionList) == 0)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue