Clarify error message for local and distributed query plans.

pull/1431/head
jmunsch 2017-06-01 11:48:20 -07:00
parent a1e44328b2
commit 1647d17a14
4 changed files with 10 additions and 11 deletions

View File

@ -2682,11 +2682,10 @@ NeedsDistributedPlanning(Query *queryTree)
}
}
/* users can't mix local and distributed relations in one query */
if (hasLocalRelation && hasDistributedRelation)
{
ereport(ERROR, (errmsg("cannot plan queries that include both regular and "
"partitioned relations")));
ereport(ERROR, (errmsg("cannot plan queries which include both local and "
"distributed relations")));
}
return hasDistributedRelation;

View File

@ -264,7 +264,7 @@ CREATE TABLE bidders ( name text, id bigint );
DELETE FROM limit_orders USING bidders WHERE limit_orders.id = 246 AND
limit_orders.bidder_id = bidders.id AND
bidders.name = 'Bernie Madoff';
ERROR: cannot plan queries that include both regular and partitioned relations
ERROR: cannot plan queries which include both local and distributed relations
-- commands containing a CTE are unsupported
WITH deleted_orders AS (INSERT INTO limit_orders DEFAULT VALUES RETURNING *)
DELETE FROM limit_orders;
@ -407,7 +407,7 @@ UPDATE limit_orders SET limit_price = 0.00 FROM bidders
WHERE limit_orders.id = 246 AND
limit_orders.bidder_id = bidders.id AND
bidders.name = 'Bernie Madoff';
ERROR: cannot plan queries that include both regular and partitioned relations
ERROR: cannot plan queries which include both local and distributed relations
-- commands containing a CTE are unsupported
WITH deleted_orders AS (INSERT INTO limit_orders DEFAULT VALUES RETURNING *)
UPDATE limit_orders SET symbol = 'GM';

View File

@ -170,7 +170,7 @@ CREATE TABLE bidders ( name text, id bigint );
DELETE FROM limit_orders_mx USING bidders WHERE limit_orders_mx.id = 246 AND
limit_orders_mx.bidder_id = bidders.id AND
bidders.name = 'Bernie Madoff';
ERROR: cannot plan queries that include both regular and partitioned relations
ERROR: cannot plan queries which include both local and distributed relations
-- commands containing a CTE are unsupported
WITH deleted_orders AS (INSERT INTO limit_orders_mx DEFAULT VALUES RETURNING *)
DELETE FROM limit_orders_mx;
@ -243,7 +243,7 @@ UPDATE limit_orders_mx SET limit_price = 0.00 FROM bidders
WHERE limit_orders_mx.id = 246 AND
limit_orders_mx.bidder_id = bidders.id AND
bidders.name = 'Bernie Madoff';
ERROR: cannot plan queries that include both regular and partitioned relations
ERROR: cannot plan queries which include both local and distributed relations
-- commands containing a CTE are unsupported
WITH deleted_orders AS (INSERT INTO limit_orders_mx DEFAULT VALUES RETURNING *)
UPDATE limit_orders_mx SET symbol = 'GM';

View File

@ -178,14 +178,14 @@ HINT: Consider using an equality filter on the distributed table's partition co
-- queries using CTEs are unsupported
WITH long_names AS ( SELECT id FROM authors WHERE char_length(name) > 15 )
SELECT title FROM articles;
ERROR: cannot plan queries that include both regular and partitioned relations
ERROR: cannot plan queries which include both local and distributed relations
-- queries which involve functions in FROM clause are unsupported.
SELECT * FROM articles, position('om' in 'Thomas');
ERROR: could not run distributed query with complex table expressions
HINT: Consider using an equality filter on the distributed table's partition column.
-- subqueries are not supported in WHERE clause in Citus
SELECT * FROM articles WHERE author_id IN (SELECT id FROM authors WHERE name LIKE '%a');
ERROR: cannot plan queries that include both regular and partitioned relations
ERROR: cannot plan queries which include both local and distributed relations
-- subqueries are supported in FROM clause
SELECT articles.id,test.word_count
FROM articles, (SELECT id, word_count FROM articles) AS test WHERE test.id = articles.id
@ -251,10 +251,10 @@ ERROR: could not run distributed query with subquery outside the FROM and WHERE
HINT: Consider using an equality filter on the distributed table's partition column.
-- joins are not supported between local and distributed tables
SELECT title, authors.name FROM authors, articles WHERE authors.id = articles.author_id;
ERROR: cannot plan queries that include both regular and partitioned relations
ERROR: cannot plan queries which include both local and distributed relations
-- inner joins are not supported (I think)
SELECT * FROM (articles INNER JOIN authors ON articles.id = authors.id);
ERROR: cannot plan queries that include both regular and partitioned relations
ERROR: cannot plan queries which include both local and distributed relations
-- test use of EXECUTE statements within plpgsql
DO $sharded_execute$
BEGIN