提交 e59aff50 编写于 作者: H Heikki Linnakangas

Set error code for "incompatible loci in target inheritance set" error.

There is a test case that reaches this, in the 'file_fdw' test. With
ERRCODE_INTERNAL_ERROR, the error message includes the source file location
(planner.c:1513) in the error message. That's problematic, because the line
number changes whenever we touch planner.c.

Since this error is in fact reachable, mark it as FEATURE_NOT_SUPPORTED.
上级 0a6312a1
......@@ -276,9 +276,9 @@ SELECT tableoid::regclass, * FROM ONLY agg;
-- updates aren't supported
UPDATE agg SET a = 1;
ERROR: incompatible loci in target inheritance set (planner.c:1513)
ERROR: incompatible loci in target inheritance set
DELETE FROM agg WHERE a = 100;
ERROR: incompatible loci in target inheritance set (planner.c:1513)
ERROR: incompatible loci in target inheritance set
-- but this should be allowed
SELECT tableoid::regclass, * FROM agg FOR UPDATE;
tableoid | a | b
......
......@@ -276,9 +276,9 @@ SELECT tableoid::regclass, * FROM ONLY agg;
-- updates aren't supported
UPDATE agg SET a = 1;
ERROR: incompatible loci in target inheritance set (planner.c:1513)
ERROR: incompatible loci in target inheritance set
DELETE FROM agg WHERE a = 100;
ERROR: incompatible loci in target inheritance set (planner.c:1513)
ERROR: incompatible loci in target inheritance set
-- but this should be allowed
SELECT tableoid::regclass, * FROM agg FOR UPDATE;
tableoid | a | b
......
......@@ -1508,9 +1508,14 @@ inheritance_planner(PlannerInfo *root)
}
if (!locus_ok)
{
ereport(ERROR, (
errcode(ERRCODE_INTERNAL_ERROR),
errmsg("incompatible loci in target inheritance set")));
/*
* This is reachable, if you have normal distributed/replicated tables,
* and foreign tables that can only be executed in the QD, in the same
* inheritance tree.
*/
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("incompatible loci in target inheritance set")));
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册