Re: [HACKERS] Adding support for Default partition in partitioning - Mailing list pgsql-hackers

From Jeevan Ladhe
Subject Re: [HACKERS] Adding support for Default partition in partitioning
Date
Msg-id CAOgcT0Ofs9SJYwnj60dgVU6H-Pq4rmRgXm4-4JnSH4sus7snkw@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Adding support for Default partition in partitioning  (Beena Emerson <memissemerson@gmail.com>)
Responses Re: [HACKERS] Adding support for Default partition in partitioning  (Rajkumar Raghuwanshi <rajkumar.raghuwanshi@enterprisedb.com>)
List pgsql-hackers
Hi,

I started looking into Rahila's default_partition_v11.patch, and reworked on
few things as below:

- I tried to cover all the review comments posted on the thread. Do let
me know if something is missing.

- Got rid of the functions get_qual_for_default() and generate_qual_for_defaultpart().
There is no need of collecting boundspecs of all the partitions in case of list
partition, the list is available in boundinfo->ndatums, an expression for
default can be created from the information that is available in boundinfo.

- Got rid of variable has_default, and added a macro for it.

- Changed the logic of checking the overlapping of existing rows in default
partition. Earlier version of patch used to build new constraints for default
partition table and then was checking if any of existing rows violate those
constraints. However, current version of patch just checks if any of the rows in
default partition satisfy the new partition's constraint and fail if there
exists any.
This logic can also be used as it is for default partition in case of RANGE
partitioning.

- Simplified grammar rule.

- Got rid of PARTITION_DEFAULT since DEFAULT is not a different partition
strategy, the applicable logic is also revised:

- There are few other code adjustments like: indentation, commenting, code
simplification etc.

- Added regression tests.

TODO:
Documentation, I am working on it. Will updated the patch soon.

PFA.

Regards,
Jeevan

On Mon, May 22, 2017 at 7:31 AM, Beena Emerson <memissemerson@gmail.com> wrote:
Hello,

Patch for default range partition has been added. PFA the rebased v12 patch for the same.
I have not removed the has_default variable yet.

--

Beena Emerson

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

Attachment

pgsql-hackers by date:

Previous
From: Vladimir Borodin
Date:
Subject: Re: [HACKERS] Broken hint bits (freeze)
Next
From: Rajkumar Raghuwanshi
Date:
Subject: Re: [HACKERS] Adding support for Default partition in partitioning