Re: [HACKERS] remove unnecessary flag has_null from PartitionBoundInfoData - Mailing list pgsql-hackers

From Ashutosh Bapat
Subject Re: [HACKERS] remove unnecessary flag has_null from PartitionBoundInfoData
Date
Msg-id CAFjFpRdm4kvV6oAKF857_KyQsA4EzN4WipJh_juo2x9OF83AGg@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] remove unnecessary flag has_null from PartitionBoundInfoData  (amul sul <sulamul@gmail.com>)
Responses Re: [HACKERS] remove unnecessary flag has_null from PartitionBoundInfoData  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Mon, Jun 12, 2017 at 3:50 PM, amul sul <sulamul@gmail.com> wrote:
> On Wed, May 17, 2017 at 10:22 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> [...]
>> I committed this with fixes for those issues, plus I renamed the macro
>> to partition_bound_accepts_nulls, which I think is more clear.
>>
> partition_bound_accepts_nulls() will alway yield true for a range
> partitioning case, because in RelationBuildPartitionDesc, we forgot to
> set boundinfo->null_index to -1.
>
> The attached patch fixes that.
>

Right now, the partition_bound_accepts_nulls() has two callers viz.
check_new_partition_bound() and get_partition_for_tuple(). Both of
those callers are calling it only in case of LIST partition. So,
having null_index uninitialized in PartitionBoundInfoData is not a
problem. But in general, we shouldn't leave a field uninitialized in
that structure, so +1 for the patch.


-- 
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Re: Alter subscription..SET - NOTICE message is comingfor table which is already removed
Next
From: Masahiko Sawada
Date:
Subject: Re: [HACKERS] Re: Alter subscription..SET - NOTICE message is comingfor table which is already removed