mirror of https://github.com/citusdata/citus.git
parent
c38c1adce1
commit
cccba66f24
|
@ -116,6 +116,14 @@ master_modify_multiple_shards(PG_FUNCTION_ARGS)
|
||||||
|
|
||||||
ErrorIfModifyQueryNotSupported(modifyQuery);
|
ErrorIfModifyQueryNotSupported(modifyQuery);
|
||||||
|
|
||||||
|
/* reject queries with a returning list */
|
||||||
|
if (list_length(modifyQuery->returningList) > 0)
|
||||||
|
{
|
||||||
|
ereport(ERROR,
|
||||||
|
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||||
|
errmsg("master_modify_multiple_shards() does not support RETURNING")));
|
||||||
|
}
|
||||||
|
|
||||||
shardIntervalList = LoadShardIntervalList(relationId);
|
shardIntervalList = LoadShardIntervalList(relationId);
|
||||||
restrictClauseList = WhereClauseList(modifyQuery->jointree);
|
restrictClauseList = WhereClauseList(modifyQuery->jointree);
|
||||||
|
|
||||||
|
|
|
@ -255,16 +255,6 @@ ErrorIfModifyQueryNotSupported(Query *queryTree)
|
||||||
"supported.")));
|
"supported.")));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* reject queries with a returning list */
|
|
||||||
if (list_length(queryTree->returningList) > 0)
|
|
||||||
{
|
|
||||||
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
|
||||||
errmsg("cannot perform distributed planning for the given"
|
|
||||||
" modification"),
|
|
||||||
errdetail("RETURNING clauses are not supported in distributed "
|
|
||||||
"modifications.")));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (commandType == CMD_INSERT || commandType == CMD_UPDATE ||
|
if (commandType == CMD_INSERT || commandType == CMD_UPDATE ||
|
||||||
commandType == CMD_DELETE)
|
commandType == CMD_DELETE)
|
||||||
{
|
{
|
||||||
|
@ -298,6 +288,11 @@ ErrorIfModifyQueryNotSupported(Query *queryTree)
|
||||||
{
|
{
|
||||||
hasNonConstQualExprs = true;
|
hasNonConstQualExprs = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (contain_mutable_functions((Node *) queryTree->returningList))
|
||||||
|
{
|
||||||
|
hasNonConstTargetEntryExprs = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (PG_VERSION_NUM >= 90500)
|
#if (PG_VERSION_NUM >= 90500)
|
||||||
|
|
|
@ -195,11 +195,6 @@ DETAIL: Multi-row INSERTs to distributed tables are not supported.
|
||||||
INSERT INTO limit_orders SELECT * FROM limit_orders;
|
INSERT INTO limit_orders SELECT * FROM limit_orders;
|
||||||
ERROR: cannot perform distributed planning for the given modifications
|
ERROR: cannot perform distributed planning for the given modifications
|
||||||
DETAIL: Subqueries are not supported in distributed modifications.
|
DETAIL: Subqueries are not supported in distributed modifications.
|
||||||
-- commands with a RETURNING clause are unsupported
|
|
||||||
INSERT INTO limit_orders VALUES (7285, 'AMZN', 3278, '2016-01-05 02:07:36', 'sell', 0.00)
|
|
||||||
RETURNING *;
|
|
||||||
ERROR: cannot perform distributed planning for the given modification
|
|
||||||
DETAIL: RETURNING clauses are not supported in distributed modifications.
|
|
||||||
-- commands containing a CTE are unsupported
|
-- commands containing a CTE are unsupported
|
||||||
WITH deleted_orders AS (DELETE FROM limit_orders RETURNING *)
|
WITH deleted_orders AS (DELETE FROM limit_orders RETURNING *)
|
||||||
INSERT INTO limit_orders DEFAULT VALUES;
|
INSERT INTO limit_orders DEFAULT VALUES;
|
||||||
|
@ -244,10 +239,6 @@ DELETE FROM limit_orders USING bidders WHERE limit_orders.id = 246 AND
|
||||||
limit_orders.bidder_id = bidders.id AND
|
limit_orders.bidder_id = bidders.id AND
|
||||||
bidders.name = 'Bernie Madoff';
|
bidders.name = 'Bernie Madoff';
|
||||||
ERROR: cannot plan queries that include both regular and partitioned relations
|
ERROR: cannot plan queries that include both regular and partitioned relations
|
||||||
-- commands with a RETURNING clause are unsupported
|
|
||||||
DELETE FROM limit_orders WHERE id = 246 RETURNING *;
|
|
||||||
ERROR: cannot perform distributed planning for the given modification
|
|
||||||
DETAIL: RETURNING clauses are not supported in distributed modifications.
|
|
||||||
-- commands containing a CTE are unsupported
|
-- commands containing a CTE are unsupported
|
||||||
WITH deleted_orders AS (INSERT INTO limit_orders DEFAULT VALUES RETURNING *)
|
WITH deleted_orders AS (INSERT INTO limit_orders DEFAULT VALUES RETURNING *)
|
||||||
DELETE FROM limit_orders;
|
DELETE FROM limit_orders;
|
||||||
|
@ -363,10 +354,6 @@ UPDATE limit_orders SET limit_price = 0.00 FROM bidders
|
||||||
limit_orders.bidder_id = bidders.id AND
|
limit_orders.bidder_id = bidders.id AND
|
||||||
bidders.name = 'Bernie Madoff';
|
bidders.name = 'Bernie Madoff';
|
||||||
ERROR: cannot plan queries that include both regular and partitioned relations
|
ERROR: cannot plan queries that include both regular and partitioned relations
|
||||||
-- commands with a RETURNING clause are unsupported
|
|
||||||
UPDATE limit_orders SET symbol = 'GM' WHERE id = 246 RETURNING *;
|
|
||||||
ERROR: cannot perform distributed planning for the given modification
|
|
||||||
DETAIL: RETURNING clauses are not supported in distributed modifications.
|
|
||||||
-- commands containing a CTE are unsupported
|
-- commands containing a CTE are unsupported
|
||||||
WITH deleted_orders AS (INSERT INTO limit_orders DEFAULT VALUES RETURNING *)
|
WITH deleted_orders AS (INSERT INTO limit_orders DEFAULT VALUES RETURNING *)
|
||||||
UPDATE limit_orders SET symbol = 'GM';
|
UPDATE limit_orders SET symbol = 'GM';
|
||||||
|
|
|
@ -62,8 +62,7 @@ ERROR: cannot perform distributed planning for the given modification
|
||||||
DETAIL: Joins are not supported in distributed modifications.
|
DETAIL: Joins are not supported in distributed modifications.
|
||||||
-- commands with a RETURNING clause are unsupported
|
-- commands with a RETURNING clause are unsupported
|
||||||
SELECT master_modify_multiple_shards('DELETE FROM multi_shard_modify_test WHERE t_key = 3 RETURNING *');
|
SELECT master_modify_multiple_shards('DELETE FROM multi_shard_modify_test WHERE t_key = 3 RETURNING *');
|
||||||
ERROR: cannot perform distributed planning for the given modification
|
ERROR: master_modify_multiple_shards() does not support RETURNING
|
||||||
DETAIL: RETURNING clauses are not supported in distributed modifications.
|
|
||||||
-- commands containing a CTE are unsupported
|
-- commands containing a CTE are unsupported
|
||||||
SELECT master_modify_multiple_shards('WITH deleted_stuff AS (INSERT INTO multi_shard_modify_test DEFAULT VALUES RETURNING *) DELETE FROM multi_shard_modify_test');
|
SELECT master_modify_multiple_shards('WITH deleted_stuff AS (INSERT INTO multi_shard_modify_test DEFAULT VALUES RETURNING *) DELETE FROM multi_shard_modify_test');
|
||||||
ERROR: cannot perform distributed planning for the given modification
|
ERROR: cannot perform distributed planning for the given modification
|
||||||
|
@ -205,8 +204,7 @@ ERROR: cannot perform distributed planning for the given modification
|
||||||
DETAIL: Joins are not supported in distributed modifications.
|
DETAIL: Joins are not supported in distributed modifications.
|
||||||
-- commands with a RETURNING clause are unsupported
|
-- commands with a RETURNING clause are unsupported
|
||||||
SELECT master_modify_multiple_shards('UPDATE multi_shard_modify_test SET t_name=''FAIL'' WHERE t_key=4 RETURNING *');
|
SELECT master_modify_multiple_shards('UPDATE multi_shard_modify_test SET t_name=''FAIL'' WHERE t_key=4 RETURNING *');
|
||||||
ERROR: cannot perform distributed planning for the given modification
|
ERROR: master_modify_multiple_shards() does not support RETURNING
|
||||||
DETAIL: RETURNING clauses are not supported in distributed modifications.
|
|
||||||
-- commands containing a CTE are unsupported
|
-- commands containing a CTE are unsupported
|
||||||
SELECT master_modify_multiple_shards('WITH t AS (INSERT INTO multi_shard_modify_test DEFAULT VALUES RETURNING *) UPDATE multi_shard_modify_test SET t_name = ''FAIL'' ');
|
SELECT master_modify_multiple_shards('WITH t AS (INSERT INTO multi_shard_modify_test DEFAULT VALUES RETURNING *) UPDATE multi_shard_modify_test SET t_name = ''FAIL'' ');
|
||||||
ERROR: cannot perform distributed planning for the given modification
|
ERROR: cannot perform distributed planning for the given modification
|
||||||
|
|
|
@ -143,10 +143,6 @@ INSERT INTO limit_orders VALUES (DEFAULT), (DEFAULT);
|
||||||
-- INSERT ... SELECT ... FROM commands are unsupported
|
-- INSERT ... SELECT ... FROM commands are unsupported
|
||||||
INSERT INTO limit_orders SELECT * FROM limit_orders;
|
INSERT INTO limit_orders SELECT * FROM limit_orders;
|
||||||
|
|
||||||
-- commands with a RETURNING clause are unsupported
|
|
||||||
INSERT INTO limit_orders VALUES (7285, 'AMZN', 3278, '2016-01-05 02:07:36', 'sell', 0.00)
|
|
||||||
RETURNING *;
|
|
||||||
|
|
||||||
-- commands containing a CTE are unsupported
|
-- commands containing a CTE are unsupported
|
||||||
WITH deleted_orders AS (DELETE FROM limit_orders RETURNING *)
|
WITH deleted_orders AS (DELETE FROM limit_orders RETURNING *)
|
||||||
INSERT INTO limit_orders DEFAULT VALUES;
|
INSERT INTO limit_orders DEFAULT VALUES;
|
||||||
|
@ -174,9 +170,6 @@ DELETE FROM limit_orders USING bidders WHERE limit_orders.id = 246 AND
|
||||||
limit_orders.bidder_id = bidders.id AND
|
limit_orders.bidder_id = bidders.id AND
|
||||||
bidders.name = 'Bernie Madoff';
|
bidders.name = 'Bernie Madoff';
|
||||||
|
|
||||||
-- commands with a RETURNING clause are unsupported
|
|
||||||
DELETE FROM limit_orders WHERE id = 246 RETURNING *;
|
|
||||||
|
|
||||||
-- commands containing a CTE are unsupported
|
-- commands containing a CTE are unsupported
|
||||||
WITH deleted_orders AS (INSERT INTO limit_orders DEFAULT VALUES RETURNING *)
|
WITH deleted_orders AS (INSERT INTO limit_orders DEFAULT VALUES RETURNING *)
|
||||||
DELETE FROM limit_orders;
|
DELETE FROM limit_orders;
|
||||||
|
@ -275,9 +268,6 @@ UPDATE limit_orders SET limit_price = 0.00 FROM bidders
|
||||||
limit_orders.bidder_id = bidders.id AND
|
limit_orders.bidder_id = bidders.id AND
|
||||||
bidders.name = 'Bernie Madoff';
|
bidders.name = 'Bernie Madoff';
|
||||||
|
|
||||||
-- commands with a RETURNING clause are unsupported
|
|
||||||
UPDATE limit_orders SET symbol = 'GM' WHERE id = 246 RETURNING *;
|
|
||||||
|
|
||||||
-- commands containing a CTE are unsupported
|
-- commands containing a CTE are unsupported
|
||||||
WITH deleted_orders AS (INSERT INTO limit_orders DEFAULT VALUES RETURNING *)
|
WITH deleted_orders AS (INSERT INTO limit_orders DEFAULT VALUES RETURNING *)
|
||||||
UPDATE limit_orders SET symbol = 'GM';
|
UPDATE limit_orders SET symbol = 'GM';
|
||||||
|
|
Loading…
Reference in New Issue