Re: negative bitmapset member not allowed Error with partitionpruning - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: negative bitmapset member not allowed Error with partitionpruning
Date
Msg-id 20180730225446.w7j7kpkeow7ljrjm@alvherre.pgsql
Whole thread Raw
In response to Re: negative bitmapset member not allowed Error with partition pruning  (David Rowley <david.rowley@2ndquadrant.com>)
List pgsql-hackers
On 2018-Jul-27, David Rowley wrote:

> On 27 July 2018 at 15:14, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> > Well, my thinking is that it helps nobody if call sites have to have
> > explicit workarounds for a totally-arbitrary refusal to handle edge
> > cases in the primitive functions.  I do not think that is good software
> > design.  If you want to have assertions that particular call sites are
> > specifying nonempty ranges, put those in the call sites where it's
> > important.  But as-is, this seems like, say, defining foreach() to
> > blow up on an empty list.
> 
> Okay, that's a fair point. I agree,  adding Asserts at the current
> call sites seems better.

Given the discussion, I pushed two commits: first, bms_add_range returns
the input bms if the range is empty, also adding Rajkumar's test case,
which I also verified to reproduce the bug, and passes (for me) with the
bms_add_range change.

The second commit includes the proposed asserts, but not the change to
avoid calling bms_add_range when the range is empty.

Thanks!

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: make installcheck-world in a clean environment
Next
From: Daniel Gustafsson
Date:
Subject: Re: Avoid extra Sort nodes between WindowAggs when sorting can bereused