Re: BUG #18344: Pruning tables partitioned by bool range fails with invalid strategy - Mailing list pgsql-bugs

From David Rowley
Subject Re: BUG #18344: Pruning tables partitioned by bool range fails with invalid strategy
Date
Msg-id CAApHDvqcY53LqR4bH2Cz3XHjCc7ZbbX0UptBCMhuwqbN-e8SRA@mail.gmail.com
Whole thread Raw
In response to Re: BUG #18344: Pruning tables partitioned by bool range fails with invalid strategy  (Alexander Lakhin <exclusion@gmail.com>)
Responses Re: BUG #18344: Pruning tables partitioned by bool range fails with invalid strategy
List pgsql-bugs
On Tue, 20 Feb 2024 at 16:00, Alexander Lakhin <exclusion@gmail.com> wrote:
> Beside that, I'm a bit confused by the opstrategy description for
> get_matching_range_bounds().
> Above that function we have:
>   * 'opstrategy' if non-zero must be a btree strategy number.
>
> But as we could see, zero opstrategy is not valid for the function (so
> "if non-zero" is meaningless here?), unlike opstrategy for
> get_matching_list_bounds(), which has the same description, but the latter
> function contains:
>      /* Special case handling of values coming from a <> operator clause. */
>      if (opstrategy == InvalidStrategy)

Yeah, that seems worth fixing in master as, I agree, the comment is
wrong.  Possibly, we considered supporting <> for RANGE partitioning
at some point, I don't recall.

I was also working on a fix for what I mentioned in [1], which, I
think, is master-only material.  I'd say we can fix the comment as
part of that.

The patch for both is attached.

David

[1] https://postgr.es/m/CAApHDvqriy8mPOFJ_Bd66YGXJ4+XULpv-4YdB+ePdCQFztyisA@mail.gmail.com

Attachment

pgsql-bugs by date:

Previous
From: Alexander Lakhin
Date:
Subject: Re: BUG #18344: Pruning tables partitioned by bool range fails with invalid strategy
Next
From: jian he
Date:
Subject: Re: BUG #18348: Inconsistency with EXTRACT([field] from INTERVAL);