Re: Boolean partitions syntax - Mailing list pgsql-hackers

From David Steele
Subject Re: Boolean partitions syntax
Date
Msg-id 2d2dea0a-8d5a-029a-502f-49f8e768aba3@pgmasters.net
Whole thread Raw
In response to Re: Boolean partitions syntax  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
On 3/21/18 10:59 PM, Amit Langote wrote:
> On 2018/03/21 23:31, David Steele wrote:
>> Hi Amit,
>>
>> On 3/6/18 9:44 AM, David Steele wrote:
>>> On 3/2/18 2:27 AM, Amit Langote wrote:
>>>> On 2018/03/02 15:58, Andres Freund wrote:
>>>>> On 2018-02-02 17:00:24 -0500, Tom Lane wrote:
>>>>>> Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
>>>>>>> There might be other options, but one way to solve this would be to
>>>>>>> treat partition bounds as a general expression in the grammar and then
>>>>>>> check in post-parse analysis that it's a constant.
>>>>>>
>>>>>> That's pretty much what I said upthread.  What I basically don't like
>>>>>> about the current setup is that it's assuming that the bound item is
>>>>>> a bare literal.  Even disregarding future-extension issues, that's bad
>>>>>> because it can't result in an error message smarter than "syntax error"
>>>>>> when someone tries the rather natural thing of writing a more complicated
>>>>>> expression.
>>>>>
>>>>> Given the current state of this patch, with a number of senior
>>>>> developers disagreeing with the design, and the last CF being in
>>>>> progress, I think we should mark this as returned with feedback.
>>>>
>>>> I see no problem with pursuing this in the next CF if the consensus is
>>>> that we should fix how partition bounds are parsed, instead of adopting
>>>> one of the patches to allow the Boolean literals to be accepted as
>>>> partition bounds.
>>>
>>> I'm inclined to mark this patch Returned with Feedback unless I hear
>>> opinions to the contrary.
>>
>> Hearing no opinions to the contrary I have marked this entry Returned
>> with Feedback.  Please resubmit when you have an updated patch.
> 
> OK.
> 
> Btw, there is an 11dev open item recently added to the wiki that's related
> to this, but I think we might be able to deal with it independently of
> this proposal.
> 
> * Partitions with bool partition keys *
> https://wiki.postgresql.org/wiki/PostgreSQL_11_Open_Items#Open_Issues

If you want to bring this patch up to date and recast it as a bug fix
for the open issue I'll be happy to add it to the CF as a bug fix.

However, it seems to me the best plan might be to start with David's
patch [1] and make it play nice with old pg_dumps.

Thanks,
-- 
-David
david@pgmasters.net

[1]

https://www.postgresql.org/message-id/flat/CAKJS1f-BL%2Br5FXSejDu%3D%2BMAvzRARaawRnQ_ZFtbv_o6tha9NJw%40mail.gmail.com#CAKJS1f-BL+r5FXSejDu=+MAvzRARaawRnQ_ZFtbv_o6tha9NJw@mail.gmail.com


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: constraint exclusion and nulls in IN (..) clause
Next
From: Bear Giles
Date:
Subject: FYI: jOOQ blog