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

From Robert Haas
Subject Re: [HACKERS] remove unnecessary flag has_null from PartitionBoundInfoData
Date
Msg-id CA+TgmoaksQE++a9xShyPbaCj3eCXPSU=T=5FN4XhT8w=hhtggA@mail.gmail.com
Whole thread Raw
In response to [HACKERS] remove unnecessary flag has_null from PartitionBoundInfoData  (Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>)
Responses Re: [HACKERS] remove unnecessary flag has_null from PartitionBoundInfoData  (Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>)
Re: [HACKERS] remove unnecessary flag has_null from PartitionBoundInfoData  (amul sul <sulamul@gmail.com>)
List pgsql-hackers
On Wed, May 17, 2017 at 6:53 AM, Jeevan Ladhe
<jeevan.ladhe@enterprisedb.com> wrote:
> As discussed in default partition thread[1], here is the patch to remove
> has_null from PartitionBoundInfoData structure.
> Basically flag has_null is not needed and null_index can be checked if the
> current bound is having a null value or not.
>
> For simplicity of future use, in attached patch I have introduced a macro
> that
> would return TRUE if the given bound has null.

This seems like a good cleanup, but:

- It makes no sense to put a macro definition in a header file when
the corresponding structure definition is private to a specific .c
file.

- You failed to update the header comment for PartitionBoundInfoData
which mentions the has_null flag.

- The comment for null_index also seems like it should be updated to
mention that -1 is the sentinel value in general, not just for
range-partitioned tables.

I committed this with fixes for those issues, plus I renamed the macro
to partition_bound_accepts_nulls, which I think is more clear.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Christoph Berg
Date:
Subject: [HACKERS] 10beta1 sequence regression failure on sparc64
Next
From: Stephen Frost
Date:
Subject: Re: [HACKERS] [bug fix] PG10: libpq doesn't connect to alternativehosts when some errors occur