mirror of https://github.com/citusdata/citus.git
Explicitly disallow local rels when inserting into dist table (#6817)
parent
dcee370270
commit
d4f9de7875
|
@ -717,6 +717,19 @@ DistributedInsertSelectSupported(Query *queryTree, RangeTblEntry *insertRte,
|
|||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Note that we've already checked the non-existence of Postgres
|
||||
* tables in the subquery.
|
||||
*/
|
||||
if (subqueryRteListProperties->hasCitusLocalTable ||
|
||||
subqueryRteListProperties->hasMaterializedView)
|
||||
{
|
||||
return DeferredError(ERRCODE_FEATURE_NOT_SUPPORTED,
|
||||
"distributed INSERT ... SELECT cannot select from "
|
||||
"a local relation when inserting into a distributed "
|
||||
"table", NULL, NULL);
|
||||
}
|
||||
|
||||
/* ensure that INSERT's partition column comes from SELECT's partition column */
|
||||
error = InsertPartitionColumnMatchesSelect(queryTree, insertRte, subqueryRte,
|
||||
&selectPartitionColumnTableId);
|
||||
|
|
Loading…
Reference in New Issue