Allow distributed INSERT...SELECT via worker nodes in MX

pull/1759/head
Marco Slot 2017-11-02 14:19:06 +01:00
parent 7280774cf4
commit 6219186683
5 changed files with 2 additions and 33 deletions

View File

@ -321,14 +321,6 @@ DistributedInsertSelectSupported(Query *queryTree, RangeTblEntry *insertRte,
NULL, NULL);
}
if (GetLocalGroupId() != 0)
{
return DeferredError(ERRCODE_FEATURE_NOT_SUPPORTED,
"distributed INSERT ... SELECT can only be performed from "
"the coordinator",
NULL, NULL);
}
/* we do not expect to see a view in modify target */
foreach(rangeTableCell, queryTree->rtable)
{

View File

@ -428,14 +428,12 @@ SELECT * FROM multiple_hash_mx WHERE category = '2' ORDER BY category, data;
INSERT INTO multiple_hash_mx
SELECT s, s*2 FROM generate_series(1,10) s;
INSERT 0 10
-- but are never distributed
-- including distributed INSERT ... SELECT
BEGIN;
BEGIN
SET LOCAL client_min_messages TO DEBUG1;
SET
INSERT INTO multiple_hash_mx SELECT * FROM multiple_hash_mx;
DEBUG: distributed INSERT ... SELECT can only be performed from the coordinator
DEBUG: Collecting INSERT ... SELECT results on coordinator
INSERT 0 10
END;
COMMIT

View File

@ -264,19 +264,6 @@ SELECT count(*) FROM mx_table;
5
(1 row)
-- INSERT / SELECT pulls results to worker
BEGIN;
SET LOCAL client_min_messages TO DEBUG;
INSERT INTO mx_table_2 SELECT * FROM mx_table;
DEBUG: distributed INSERT ... SELECT can only be performed from the coordinator
DEBUG: Collecting INSERT ... SELECT results on coordinator
END;
SELECT count(*) FROM mx_table_2;
count
-------
5
(1 row)
-- mark_tables_colocated
UPDATE pg_dist_partition SET colocationid = 0 WHERE logicalrelid='mx_table_2'::regclass;
SELECT mark_tables_colocated('mx_table', ARRAY['mx_table_2']);

View File

@ -276,7 +276,7 @@ SELECT * FROM multiple_hash_mx WHERE category = '2' ORDER BY category, data;
INSERT INTO multiple_hash_mx
SELECT s, s*2 FROM generate_series(1,10) s;
-- but are never distributed
-- including distributed INSERT ... SELECT
BEGIN;
SET LOCAL client_min_messages TO DEBUG1;
INSERT INTO multiple_hash_mx SELECT * FROM multiple_hash_mx;

View File

@ -138,14 +138,6 @@ SELECT master_remove_node('localhost', 5432);
TRUNCATE mx_table;
SELECT count(*) FROM mx_table;
-- INSERT / SELECT pulls results to worker
BEGIN;
SET LOCAL client_min_messages TO DEBUG;
INSERT INTO mx_table_2 SELECT * FROM mx_table;
END;
SELECT count(*) FROM mx_table_2;
-- mark_tables_colocated
UPDATE pg_dist_partition SET colocationid = 0 WHERE logicalrelid='mx_table_2'::regclass;