Getting ERROR "subplan "SubPlan 1" was not initialized" in EXISTS subplan when using for list partition.

From: Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Getting ERROR "subplan "SubPlan 1" was not initialized" in EXISTS subplan when using for list partition.
Date: 2021-09-14 11:49:15
Message-ID: CAKcux6==O3NNZC3bZ2prRYv3cjm3_Zw1GfzmOjEVqYN4jub2+Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I am getting "ERROR: subplan "SubPlan 1" was not initialized" error with
below test case.

CREATE TABLE tbl ( c1 int, c2 int, c3 int ) PARTITION BY LIST (c1);
create table tbl_null PARTITION OF tbl FOR VALUES IN (null);
create table tbl_def PARTITION OF tbl DEFAULT;
insert into tbl values (8800,0,0);
insert into tbl values (1891,1,1);
insert into tbl values (3420,2,0);
insert into tbl values (9850,3,0);
insert into tbl values (7164,4,4);
analyze tbl;
explain (costs off) select count(*) from tbl t1 where (exists(select 1 from
tbl t2 where t2.c1 = t1.c2) or c3 < 0);

postgres=# explain (costs off) select count(*) from tbl t1 where
(exists(select 1 from tbl t2 where t2.c1 = t1.c2) or c3 < 0);
ERROR: subplan "SubPlan 1" was not initialized

Thanks & Regards,
Rajkumar Raghuwanshi

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2021-09-14 11:49:43 Re: Physical replication from x86_64 to ARM64
Previous Message Aleksander Alekseev 2021-09-14 11:37:26 Re: Increase value of OUTER_VAR