Re: [HACKERS] NOT NULL constraints on range partition key columns - Mailing list pgsql-hackers

From Amit Langote
Subject Re: [HACKERS] NOT NULL constraints on range partition key columns
Date
Msg-id ac6974a7-0e9f-7f37-431f-0dece70d94e6@lab.ntt.co.jp
Whole thread Raw
In response to Re: [HACKERS] NOT NULL constraints on range partition key columns  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: [HACKERS] NOT NULL constraints on range partition key columns
List pgsql-hackers
On 2017/05/16 21:16, Amit Kapila wrote:
> On Tue, May 16, 2017 at 3:26 PM, Amit Langote
> <Langote_Amit_f8@lab.ntt.co.jp> wrote:
>> On 2017/05/16 4:29, Robert Haas wrote:
>>> Yeah, that's exactly why I think we should make the change Amit is
>>> proposing here.  If we don't, then we won't be able to accept NULL
>>> values even after we have the default partitioning stuff.
>>
>> Attached is a patch for consideration.  There are 2 actually, but maybe
>> they should be committed together if we decide do go with this.
>>
> 
> After your changes in get_qual_for_range(), below comment in that
> function needs an update and I feel it is better to update the
> function header as well.
> 
> /*
> * A range-partitioned table does not allow partition keys to be null. For
> * simple columns, their NOT NULL constraint suffices for the enforcement
> * of non-nullability.  But for the expression keys, which are still
> * nullable, we must emit a IS NOT NULL expression.  Collect them in
> * result first.
> */

Thanks for the review.  I updated the comments.

Thanks,
Amit

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

pgsql-hackers by date:

Previous
From: Haribabu Kommi
Date:
Subject: Re: [HACKERS] Increasing parallel workers at runtime
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] PG10 pgindent run