Re: [HACKERS] Default Partition for Range

2017-09-05 Thread Beena Emerson
Hello all, This is to inform all that this patch has been merged with default list partition patch [1]. There will be no further updates here. The status of this will be updated on the commitfest according to progres on that thread. [1] https://www.postgresql.org/message-id/CAOgcT0ONgwajdtkoq%2

Re: [HACKERS] Default Partition for Range

2017-08-24 Thread Beena Emerson
Hello, On Thu, Aug 24, 2017 at 3:08 PM, Jeevan Ladhe wrote: > Hi Beena, > > > On Tue, Aug 22, 2017 at 5:22 PM, Beena Emerson > wrote: >> >> On Tue, Aug 22, 2017 at 4:20 PM, Beena Emerson >> wrote: >> > Hi Jeevan, >> > >> > On Tue, Aug 22, 2017 at 7:53 AM, Jeevan Ladhe >> > wrote: >> >> >> >> >

Re: [HACKERS] Default Partition for Range

2017-08-24 Thread Jeevan Ladhe
Hi Beena, On Tue, Aug 22, 2017 at 5:22 PM, Beena Emerson wrote: > On Tue, Aug 22, 2017 at 4:20 PM, Beena Emerson > wrote: > > Hi Jeevan, > > > > On Tue, Aug 22, 2017 at 7:53 AM, Jeevan Ladhe > > wrote: > >> > >> > >> 4. > >> static List * > >> -get_qual_for_range(PartitionKey key, PartitionB

Re: [HACKERS] Default Partition for Range

2017-08-22 Thread Beena Emerson
On Tue, Aug 22, 2017 at 4:20 PM, Beena Emerson wrote: > Hi Jeevan, > > On Tue, Aug 22, 2017 at 7:53 AM, Jeevan Ladhe > wrote: >> >> >> 4. >> static List * >> -get_qual_for_range(PartitionKey key, PartitionBoundSpec *spec) >> +get_qual_for_range(Relation parent, PartitionBoundSpec *spec, >> +

Re: [HACKERS] Default Partition for Range

2017-08-22 Thread Beena Emerson
Hi Jeevan, On Tue, Aug 22, 2017 at 7:53 AM, Jeevan Ladhe wrote: > > Hi Beena, > > On Thu, Aug 17, 2017 at 4:59 PM, Beena Emerson > wrote: >> >> PFA the patch rebased over v25 patches of default list partition [1] > > > Thanks for rebasing. > > Range partition review: Thank you for your review.

Re: [HACKERS] Default Partition for Range

2017-08-21 Thread Jeevan Ladhe
Hi Beena, On Thu, Aug 17, 2017 at 4:59 PM, Beena Emerson wrote: > PFA the patch rebased over v25 patches of default list partition [1] > Thanks for rebasing. Range partition review: 1. There are lot of changes in RelationBuildPartitionDesc(). It was hard to understand why these changes are ne

Re: [HACKERS] Default Partition for Range

2017-08-17 Thread Beena Emerson
PFA the patch rebased over v25 patches of default list partition [1] [1] https://www.postgresql.org/message-id/CAOgcT0NwqnavYtu-QM-DAZ6N%3DwTiqKgy83WwtO2x94LSLZ1-Sw%40mail.gmail.com -- Beena Emerson EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company default_range

Re: [HACKERS] Default Partition for Range

2017-08-17 Thread Beena Emerson
Hello, PFA the updated patch which returns NULL instead of true when the default partition has no constraints and also have modified the output as discussed above. This applies over v24 patch [1] of default list partition. I will rebase over the next version when it is updated. [1] https://www.

Re: [HACKERS] Default Partition for Range

2017-08-10 Thread Robert Haas
On Thu, Aug 10, 2017 at 6:56 AM, Jeevan Ladhe wrote: >> This looks like a problem with the default list partitioning patch. I >> think "true" is what we expect to see here in both cases. > > In case of list partition if there is only default partition, then there is > no > specific value set that

Re: [HACKERS] Default Partition for Range

2017-08-10 Thread Jeevan Ladhe
Hi Robert, Beena, On Wed, Aug 9, 2017 at 5:53 PM, Robert Haas wrote: > On Wed, Aug 9, 2017 at 8:18 AM, Rajkumar Raghuwanshi > wrote: > > --difference in the description of default partition in case of list vs > > range > > > > create table lp (a int) partition by list(a); > > create table lp_d

Re: [HACKERS] Default Partition for Range

2017-08-09 Thread Robert Haas
On Wed, Aug 9, 2017 at 8:18 AM, Rajkumar Raghuwanshi wrote: > --difference in the description of default partition in case of list vs > range > > create table lp (a int) partition by list(a); > create table lp_d partition of lp DEFAULT; > postgres=# \d+ lp_d >Ta

Re: [HACKERS] Default Partition for Range

2017-08-09 Thread Rajkumar Raghuwanshi
On Wed, Aug 9, 2017 at 1:54 PM, Beena Emerson wrote: > Hello Rajkumar, > > On Wed, Aug 9, 2017 at 12:37 PM, Rajkumar Raghuwanshi > wrote: > > > > Hi Beena, > > > > I have applied Jeevan's v24 patches and then your v9 patch over commit > > 5ff3d73813ebcc3ff80be77c30b458d728951036. > > and while t

Re: [HACKERS] Default Partition for Range

2017-08-09 Thread Beena Emerson
Hello Rajkumar, On Wed, Aug 9, 2017 at 12:37 PM, Rajkumar Raghuwanshi wrote: > > Hi Beena, > > I have applied Jeevan's v24 patches and then your v9 patch over commit > 5ff3d73813ebcc3ff80be77c30b458d728951036. > and while testing I got a server crash. below is sql to reproduce it. > > postgres=#

Re: [HACKERS] Default Partition for Range

2017-08-09 Thread Rajkumar Raghuwanshi
On Wed, Aug 9, 2017 at 8:26 AM, Beena Emerson wrote: > I have updated the patch to make it similar to the way default/null is > handled in list partition, removing the PARTITION_RANGE_DATUM_DEFAULT. > This is to be applied over v24 patches shared by Jeevan [1] which > applies on commit id 5ff3d73

Re: [HACKERS] Default Partition for Range

2017-08-08 Thread Beena Emerson
On Fri, Aug 4, 2017 at 7:48 PM, Robert Haas wrote: > On Mon, Jul 31, 2017 at 8:28 AM, Beena Emerson > wrote: > > Why do we need to introduce PARTITION_RANGE_DATUM_DEFAULT at all? It > seems to me that the handling of default range partitions ought to be > similar to the way a null-accepting lis

Re: [HACKERS] Default Partition for Range

2017-08-04 Thread Robert Haas
On Mon, Jul 31, 2017 at 8:28 AM, Beena Emerson wrote: > Thanks for informing. > PFA the updated patch. > I have changed the numbering of enum PartitionRangeDatumKind since I > have to include DEFAULT as well. If you have better ideas, let me > know. Why do we need to introduce PARTITION_RANGE_DAT

Re: [HACKERS] Default Partition for Range

2017-07-31 Thread Beena Emerson
On Wed, Jul 26, 2017 at 7:05 PM, Jeevan Ladhe wrote: > Hi Beena, > > I have posted the rebased patches[1] for default list partition. > Your patch also needs a rebase. > > [1] > https://www.postgresql.org/message-id/CAOgcT0OVwDu%2BbeChWb5R5s6rfKLCiWcZT5617hqu7T3GdA1hAw%40mail.gmail.com > Thanks f

Re: [HACKERS] Default Partition for Range

2017-07-26 Thread Jeevan Ladhe
Hi Beena, I have posted the rebased patches[1] for default list partition. Your patch also needs a rebase. [1] https://www.postgresql.org/message-id/CAOgcT0OVwDu%2BbeChWb5R5s6rfKLCiWcZT5617hqu7T3GdA1hAw%40mail.gmail.com Regards, Jeevan Ladhe On Fri, Jul 14, 2017 at 3:28 PM, Beena Emerson wrote

Re: [HACKERS] Default Partition for Range

2017-07-14 Thread Beena Emerson
On Tue, Jul 4, 2017 at 4:21 PM, Rahila Syed wrote: > > Hello Beena, > > Thanks for the updated patch. It passes the basic tests which I performed. > > Few comments: > 1. In check_new_partition_bound(), > >> /* Default case is not handled here */ >>if (spec->is_default) >>

Re: [HACKERS] Default Partition for Range

2017-07-14 Thread Beena Emerson
Thank you for your review Dilip and Rahila. PFA the updated patch which is rebased to Jeevan's latest list partition patch [1] and also handles your comments. https://www.postgresql.org/message-id/CAOgcT0OARciE2X%2BU0rjSKp9VuC279dYcCGkc3nCWKhHQ1_m2rw%40mail.gmail.com -- Beena Emerson Enterpri

Re: [HACKERS] Default Partition for Range

2017-07-14 Thread Beena Emerson
On Mon, Jul 3, 2017 at 8:00 PM, Dilip Kumar wrote: > On Fri, Jun 30, 2017 at 11:56 AM, Beena Emerson > wrote: >> Hello Dilip, >> >> On Wed, Jun 21, 2017 at 6:27 PM, Dilip Kumar wrote: >>> On Tue, Jun 20, 2017 at 6:57 PM, Dilip Kumar wrote: This is basically crashing in RelationBuildPartit

Re: [HACKERS] Default Partition for Range

2017-07-04 Thread Rahila Syed
Hello Beena, Thanks for the updated patch. It passes the basic tests which I performed. Few comments: 1. In check_new_partition_bound(), > /* Default case is not handled here */ >if (spec->is_default) >break; The default partition check here can be performed

Re: [HACKERS] Default Partition for Range

2017-07-03 Thread Dilip Kumar
On Fri, Jun 30, 2017 at 11:56 AM, Beena Emerson wrote: > Hello Dilip, > > On Wed, Jun 21, 2017 at 6:27 PM, Dilip Kumar wrote: >> On Tue, Jun 20, 2017 at 6:57 PM, Dilip Kumar wrote: >>> This is basically crashing in RelationBuildPartitionDesc, so I think > > Thank you for your review and analysi

Re: [HACKERS] Default Partition for Range

2017-06-29 Thread Beena Emerson
Hello Dilip, On Wed, Jun 21, 2017 at 6:27 PM, Dilip Kumar wrote: > On Tue, Jun 20, 2017 at 6:57 PM, Dilip Kumar wrote: >> This is basically crashing in RelationBuildPartitionDesc, so I think >> we don't have any test case for testing DEFAULT range partition where >> partition key has more than o

Re: [HACKERS] Default Partition for Range

2017-06-28 Thread Beena Emerson
Hello Rahila, On Wed, Jun 28, 2017 at 12:34 PM, Rahila Syed wrote: > Hi Beena, > > I started testing and reviewing the patch. Can you update the patch as v5 > patch does not apply cleanly on master? > Thanks for looking into this. The patch is to be applied on Jeevn's partition patch (http://ww

Re: [HACKERS] Default Partition for Range

2017-06-28 Thread Beena Emerson
On Wed, Jun 28, 2017 at 12:34 PM, Rahila Syed wrote: > Hi Beena, > > I started testing and reviewing the patch. Can you update the patch as v5 > patch does not apply cleanly on master? > I am currently working on Dilip's comments, I will update the patch soon. -- Beena Emerson EnterpriseDB: h

Re: [HACKERS] Default Partition for Range

2017-06-28 Thread Rahila Syed
Hi Beena, I started testing and reviewing the patch. Can you update the patch as v5 patch does not apply cleanly on master? Thank you, Rahila Syed On Wed, Jun 21, 2017 at 8:43 PM, Dilip Kumar wrote: > On Wed, Jun 21, 2017 at 8:08 PM, Robert Haas > wrote: > > I think somebody should do some te

Re: [HACKERS] Default Partition for Range

2017-06-21 Thread Dilip Kumar
On Wed, Jun 21, 2017 at 8:08 PM, Robert Haas wrote: > I think somebody should do some testing of the existing code with > valgrind. And then apply the list-partitioning patch and this patch, > and do some more testing with valgrind. It seems to be really easy to > miss these uninitialized access

Re: [HACKERS] Default Partition for Range

2017-06-21 Thread Robert Haas
On Wed, Jun 21, 2017 at 8:57 AM, Dilip Kumar wrote: > For the default partition we are only setting bound->content[0] to > default, but content for others key > attributes are not initialized. But later in the code, if the content > of the first key is RANGE_DATUM_DEFAULT then it should not acces

Re: [HACKERS] Default Partition for Range

2017-06-21 Thread Dilip Kumar
On Tue, Jun 20, 2017 at 6:57 PM, Dilip Kumar wrote: > This is basically crashing in RelationBuildPartitionDesc, so I think > we don't have any test case for testing DEFAULT range partition where > partition key has more than one attribute. So I suggest we can add > such test case. Some more comm

Re: [HACKERS] Default Partition for Range

2017-06-20 Thread Dilip Kumar
On Thu, Jun 15, 2017 at 11:20 AM, Beena Emerson wrote: > Hello, > > PFA the updated patch. > This is rebased over v21 patches of list partition. > (http://www.mail-archive.com/pgsql-hackers@postgresql.org/msg316818.html) While testing I have noticed segmentation fault for a simple case. create t

Re: [HACKERS] Default Partition for Range

2017-06-14 Thread Beena Emerson
Hello, PFA the updated patch. This is rebased over v21 patches of list partition. (http://www.mail-archive.com/pgsql-hackers@postgresql.org/msg316818.html) -- Beena Emerson EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company default_range_partition_v5.patch Descripti

Re: [HACKERS] Default Partition for Range

2017-06-05 Thread Beena Emerson
Hello Dilip, On Mon, Jun 5, 2017 at 8:44 PM, Dilip Kumar wrote: > On Mon, Jun 5, 2017 at 1:43 AM, Beena Emerson wrote: >> The new patch is rebased over default_partition_v18.patch >> [http://www.mail-archive.com/pgsql-hackers@postgresql.org/msg315831.html] > > I have done the initial review of t

Re: [HACKERS] Default Partition for Range

2017-06-05 Thread Dilip Kumar
On Mon, Jun 5, 2017 at 1:43 AM, Beena Emerson wrote: > The new patch is rebased over default_partition_v18.patch > [http://www.mail-archive.com/pgsql-hackers@postgresql.org/msg315831.html] I have done the initial review of the patch, I have few comments. + if ((lower->content[0] == RANGE_DATUM_

Re: [HACKERS] Default Partition for Range

2017-06-04 Thread Beena Emerson
Hello, On Sun, Jun 4, 2017 at 9:26 AM, Rafia Sabih wrote: > On Fri, Jun 2, 2017 at 5:48 PM, Robert Haas wrote: >> On Fri, Jun 2, 2017 at 8:09 AM, Amit Kapila wrote: >>> I think if you have found spelling mistakes unrelated to this patch, >>> then it is better to submit those as a separate patch

Re: [HACKERS] Default Partition for Range

2017-06-03 Thread Rafia Sabih
On Fri, Jun 2, 2017 at 5:48 PM, Robert Haas wrote: > On Fri, Jun 2, 2017 at 8:09 AM, Amit Kapila wrote: >> I think if you have found spelling mistakes unrelated to this patch, >> then it is better to submit those as a separate patch in a new thread. > > +1. Sure, attached is the version without

Re: [HACKERS] Default Partition for Range

2017-06-02 Thread Robert Haas
On Fri, Jun 2, 2017 at 8:09 AM, Amit Kapila wrote: > I think if you have found spelling mistakes unrelated to this patch, > then it is better to submit those as a separate patch in a new thread. +1. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company --

Re: [HACKERS] Default Partition for Range

2017-06-02 Thread Amit Kapila
On Fri, Jun 2, 2017 at 4:12 PM, Rafia Sabih wrote: > On Wed, May 31, 2017 at 5:53 PM, Beena Emerson > wrote: > > Hi Beena, > > I had a look at the patch from the angle of aesthetics and there are a > few cosmetic changes I might suggest. Please have a look at the > attached patch and if you agre

Re: [HACKERS] Default Partition for Range

2017-06-02 Thread Rafia Sabih
On Wed, May 31, 2017 at 5:53 PM, Beena Emerson wrote: > Hello, > > PFA the updated patch. > Dependent patch default_partition_v17.patch [1] > This patch adds regression tests and removes the separate function to > get default partition qual. > > > On Mon, May 29, 2017 at 3:22 PM, Jeevan Ladhe > w

Re: [HACKERS] Default Partition for Range

2017-05-31 Thread Beena Emerson
Hello, PFA the updated patch. Dependent patch default_partition_v17.patch [1] This patch adds regression tests and removes the separate function to get default partition qual. On Mon, May 29, 2017 at 3:22 PM, Jeevan Ladhe wrote: > Hi Beena, > > I went through your patch, and here are some of my

Re: [HACKERS] Default Partition for Range

2017-05-29 Thread Beena Emerson
On Mon, May 29, 2017 at 3:22 PM, Jeevan Ladhe wrote: > Hi Beena, > > I went through your patch, and here are some of my comments: > Thank you for your comments. I will take care of them in the next version of patch. > - I am sorry, but I could not understand following hunk. Does this change > r

Re: [HACKERS] Default Partition for Range

2017-05-29 Thread Jeevan Ladhe
Hi Beena, I went through your patch, and here are some of my comments: - For generating a qual for default range partition, instead of scanning for all the children and collecting all the boundspecs, how about creating and negating an expression from the lists of lowerdatums and upperdatums in bo

Re: [HACKERS] Default Partition for Range

2017-05-23 Thread Beena Emerson
Hello, On Mon, May 22, 2017 at 11:29 AM, Ashutosh Bapat < ashutosh.ba...@enterprisedb.com> wrote: > On Mon, May 22, 2017 at 7:27 AM, Beena Emerson > wrote: > Would it be more readable if this reads as NOT > (constraint_for_partition_1 || constraint_for_partition_2 || > constraint_for_partition_3

Re: [HACKERS] Default Partition for Range

2017-05-21 Thread Ashutosh Bapat
On Mon, May 22, 2017 at 7:27 AM, Beena Emerson wrote: > Hello, > > Many were in favour of the default partition for tables partitioned by range > [1]. > Please find attached the WIP patch for the same which can be applied over > the default_partition_v12.patch. > > Syntax: Same as agreed for list: