Update error message

pull/472/head
Brian Cloutier 2016-04-28 05:03:59 -07:00
parent 72184f3f8d
commit 50484331a6
3 changed files with 10 additions and 10 deletions

View File

@ -354,8 +354,8 @@ ErrorIfModifyQueryNotSupported(Query *queryTree)
if (hasNonConstTargetEntryExprs || hasNonConstQualExprs)
{
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("cannot plan sharded modification containing values "
"which are not constants or constant expressions")));
errmsg("functions used in modification queries on distributed "
"tables must be marked IMMUTABLE")));
}
if (specifiesPartitionValue)

View File

@ -155,16 +155,16 @@ SET client_min_messages TO DEFAULT;
-- commands with non-constant partition values are unsupported
INSERT INTO limit_orders VALUES (random() * 100, 'ORCL', 152, '2011-08-25 11:50:45',
'sell', 0.58);
ERROR: cannot plan sharded modification containing values which are not constants or constant expressions
ERROR: functions used in modification queries on distributed tables must be marked IMMUTABLE
-- commands with expressions that cannot be collapsed are unsupported
INSERT INTO limit_orders VALUES (2036, 'GOOG', 5634, now(), 'buy', random());
ERROR: cannot plan sharded modification containing values which are not constants or constant expressions
ERROR: functions used in modification queries on distributed tables must be marked IMMUTABLE
-- commands with mutable functions in their quals
DELETE FROM limit_orders WHERE id = 246 AND bidder_id = (random() * 1000);
ERROR: cannot plan sharded modification containing values which are not constants or constant expressions
ERROR: functions used in modification queries on distributed tables must be marked IMMUTABLE
-- commands with mutable but non-volatilte functions(ie: stable func.) in their quals
DELETE FROM limit_orders WHERE id = 246 AND placed_at = current_timestamp;
ERROR: cannot plan sharded modification containing values which are not constants or constant expressions
ERROR: functions used in modification queries on distributed tables must be marked IMMUTABLE
-- commands with multiple rows are unsupported
INSERT INTO limit_orders VALUES (DEFAULT), (DEFAULT);
ERROR: cannot perform distributed planning for the given modification
@ -337,7 +337,7 @@ SELECT symbol, bidder_id FROM limit_orders WHERE id = 246;
-- updates referencing non-IMMUTABLE functions are unsupported
UPDATE limit_orders SET placed_at = now() WHERE id = 246;
ERROR: cannot plan sharded modification containing values which are not constants or constant expressions
ERROR: functions used in modification queries on distributed tables must be marked IMMUTABLE
-- cursors are not supported
UPDATE limit_orders SET symbol = 'GM' WHERE CURRENT OF cursor_name;
ERROR: distributed modifications must target exactly one shard

View File

@ -223,15 +223,15 @@ DETAIL: Subqueries are not supported in distributed modifications.
-- non mutable function call in the SET
INSERT INTO upsert_test (part_key, other_col) VALUES (1, 1) ON CONFLICT (part_key) DO
UPDATE SET other_col = random()::int;
ERROR: cannot plan sharded modification containing values which are not constants or constant expressions
ERROR: functions used in modification queries on distributed tables must be marked IMMUTABLE
-- non mutable function call in the WHERE
INSERT INTO upsert_test (part_key, other_col) VALUES (1, 1) ON CONFLICT (part_key) DO
UPDATE SET other_col = 5 WHERE upsert_test.other_col = random()::int;
ERROR: cannot plan sharded modification containing values which are not constants or constant expressions
ERROR: functions used in modification queries on distributed tables must be marked IMMUTABLE
-- non mutable function call in the arbiter WHERE
INSERT INTO upsert_test (part_key, other_col) VALUES (1, 1) ON CONFLICT (part_key) WHERE part_key = random()::int
DO UPDATE SET other_col = 5;
ERROR: cannot plan sharded modification containing values which are not constants or constant expressions
ERROR: functions used in modification queries on distributed tables must be marked IMMUTABLE
-- error out on attempt to update the partition key
INSERT INTO upsert_test (part_key, other_col) VALUES (1, 1) ON CONFLICT (part_key) DO
UPDATE SET part_key = 15;