pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Rajkumar Raghuwanshi <rajkumar.raghuwanshi@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: negative bitmapset member not allowed Error with partition pruning
Date: Thu, 26 Jul 2018 12:28:23 -0400
Message-ID: <16590.1532622503@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKcux6k=udMa_oOXnbHduBwvJ8SnUaQxRLPA=D2+ryYoyT6eeA@mail.gmail.com>
References: <CAKcux6k=udMa_oOXnbHduBwvJ8SnUaQxRLPA=D2+ryYoyT6eeA@mail.gmail.com>

Rajkumar Raghuwanshi <rajkumar.raghuwanshi@enterprisedb.com> writes:
> I am getting "ERROR:  negative bitmapset member not allowed" when
> enable_partition_pruning set to true with below test case.

Confirmed here.  It's failing in perform_pruning_combine_step,
which reaches this:

        result->bound_offsets = bms_add_range(NULL, 0, boundinfo->ndatums - 1);

with boundinfo->ndatums == 0.  It's not clear to me whether that situation
should be impossible or not.  If it is valid, perhaps all we need is
something like

        if (boundinfo->ndatums > 0)
            result->bound_offsets = bms_add_range(NULL, 0, boundinfo->ndatums - 1);
        else
            result->bound_offsets = NULL;

although that then opens the question of whether downstream code is
OK with bound_offsets being empty.

(BTW, I'm not sure that it was wise to design bms_add_range to fail for
empty ranges.  Maybe it'd be better to redefine it as a no-op for
upper < lower?)

			regards, tom lane




view thread (8+ messages)  latest in thread

Message-ID: <16590.1532622503@sss.pgh.pa.us>
Permalink:  ../16590.1532622503@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16590.1532622503@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, rajkumar.raghuwanshi@enterprisedb.com
  Subject: Re: negative bitmapset member not allowed Error with partition pruning
  In-Reply-To: <16590.1532622503@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox