Re: remove unnecessary flag has_null from PartitionBoundInfoData
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>
Cc: PostgreSQL Developers <pgsql-hackers@postgresql.org>
Date: 2017-05-17T16:52:29Z
Lists: 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
Commits
-
Always initialize PartitionBoundInfoData's null_index.
- 096f1ccd5290 10.0 landed
-
Remove redundant has_null member from PartitionBoundInfoData.
- 236d6d462d2c 10.0 landed