weixin_39945792
2021-01-11 04:00 阅读 7

ERROR: JOIN qualification may not refer to other relations. (initsplan.c:285)

Bumped into this while debugging issue #332:


create table r (a int) distributed by (a);
create table p (a int, b int) distributed by (a);
create table p2 (a int, b int) inherits (p) distributed by (b);

postgres=# explain delete from p where b = 1 or (b=2 and a in (select b from r));
ERROR:  JOIN qualification may not refer to other relations. (initsplan.c:285)

该提问来源于开源项目:greenplum-db/gpdb

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

5条回答 默认 最新

  • weixin_39945792 weixin_39945792 2021-01-11 04:00

    A-ha! I'm not sure how exactly that leads to the error, but a "mutator" is always supposed to create a deep copy of the tree, so that's clearly a bug.

    点赞 评论 复制链接分享
  • weixin_39945792 weixin_39945792 2021-01-11 04:00

    It would be good to grep through all our "mutator" functions to make sure there are no more bugs like this lurking, i.e. ensure that they all create a deep copy.

    点赞 评论 复制链接分享
  • weixin_39945792 weixin_39945792 2021-01-11 04:00

    Committed PR #1630, which fixed this issue. Closing.

    点赞 评论 复制链接分享
  • weixin_39541767 weixin_39541767 2021-01-11 04:00

    I'm experiencing a similar issue at GP v.4.3.11.1 ERROR: JOIN qualification may not refer to other relations. (initsplan.c:237) My query has multiple subqueries in a DELETE statement. What is the version that is going to include this fix ?

    I have another instance in v.4.3.9, and my query works fine there.

    点赞 评论 复制链接分享
  • weixin_39945792 weixin_39945792 2021-01-11 04:00

    On 02/09/2017 08:49 PM, Kelvien Hidayat wrote:

    I'm experiencing a similar issue at GP v.4.3.11.1 ERROR: JOIN qualification may not refer to other relations. (initsplan.c:237) My query has multiple subqueries in a DELETE statement. What is the version that is going to include this fix ?

    This should be fixed in the minor version. I guess that would be 4.3.12 or 4.3.11.2.

    • Heikki
    点赞 评论 复制链接分享

相关推荐