negative bitmapset member not allowed Error with partition pruning - Mailing list pgsql-hackers

From Rajkumar Raghuwanshi
Subject negative bitmapset member not allowed Error with partition pruning
Date
Msg-id CAKcux6k=udMa_oOXnbHduBwvJ8SnUaQxRLPA=D2+ryYoyT6eeA@mail.gmail.com
Whole thread Raw
Responses Re: negative bitmapset member not allowed Error with partition pruning  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

I am getting "ERROR:  negative bitmapset member not allowed" when enable_partition_pruning set to true with below test case.

[edb@localhost bin]$ ./psql postgres
psql (12devel)
Type "help" for help.

postgres=# SET enable_partition_pruning TO on;
SET
postgres=# CREATE TABLE part (a INT, b INT) PARTITION BY LIST(a);
CREATE TABLE
postgres=# CREATE TABLE part_p1 PARTITION OF part FOR VALUES IN (-2,-1,0,1,2);
CREATE TABLE
postgres=# CREATE TABLE part_p2 PARTITION OF part DEFAULT PARTITION BY RANGE(a);
CREATE TABLE
postgres=# CREATE TABLE part_p2_p1 PARTITION OF part_p2 DEFAULT;
CREATE TABLE
postgres=# INSERT INTO part VALUES (-1,-1),(1,1),(2,NULL),(NULL,-2),(NULL,NULL);
INSERT 0 5
postgres=# EXPLAIN (COSTS OFF)
postgres-# SELECT tableoid::regclass as part, a, b FROM part WHERE a IS NULL ORDER BY 1, 2, 3;
ERROR:  negative bitmapset member not allowed

postgres=# SET enable_partition_pruning TO off;
SET
postgres=# EXPLAIN (COSTS OFF)
SELECT tableoid::regclass as part, a, b FROM part WHERE a IS NULL ORDER BY 1, 2, 3;
                               QUERY PLAN                              
------------------------------------------------------------------------
 Sort
   Sort Key: ((part_p1.tableoid)::regclass), part_p1.a, part_p1.b
   ->  Append
         ->  Seq Scan on part_p1
               Filter: (a IS NULL)
         ->  Seq Scan on part_p2_p1
               Filter: (a IS NULL)
(7 rows)

postgres=#


Thanks & Regards,
Rajkumar Raghuwanshi
QMG, EnterpriseDB Corporation

pgsql-hackers by date:

Previous
From: Bertrand DROUVOT
Date:
Subject: Re: [Proposal] Add accumulated statistics for wait event
Next
From: "Imai, Yoshikazu"
Date:
Subject: RE: Locking B-tree leafs immediately in exclusive mode