Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2017-10-18 Thread Robert Haas
On Wed, Oct 18, 2017 at 1:18 PM, Alvaro Herrera wrote: > I'm okay with prohibiting the case of different persistence values as > you suggest. And I do suggest to back-patch that prohibition to pg10. I disagree. There's nothing any more broken about the way this works with partitioning in v10 th

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2017-10-18 Thread Alvaro Herrera
Robert Haas wrote: > On Wed, Oct 18, 2017 at 11:27 AM, Alvaro Herrera > wrote: > > Maybe there are combinations of different persistence values that can be > > allowed to differ (an unlogged partition is probably OK with a permanent > > parent), but I don't think the current check is good enough.

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2017-10-18 Thread Robert Haas
On Wed, Oct 18, 2017 at 11:27 AM, Alvaro Herrera wrote: > Maybe there are combinations of different persistence values that can be > allowed to differ (an unlogged partition is probably OK with a permanent > parent), but I don't think the current check is good enough. This is also a sort of long-

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2017-10-18 Thread Tom Lane
Robert Haas writes: > On Wed, Oct 18, 2017 at 4:53 AM, Alvaro Herrera > wrote: >> My view is that the fact that partitioning uses inheritance is just an >> implementation detail. We shouldn't let historical behavior for >> inheritance dictate behavior for partitioning. Inheritance has many >>

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2017-10-18 Thread Robert Haas
On Wed, Oct 18, 2017 at 4:53 AM, Alvaro Herrera wrote: > My view is that the fact that partitioning uses inheritance is just an > implementation detail. We shouldn't let historical behavior for > inheritance dictate behavior for partitioning. Inheritance has many > undesirable warts. I am OK wi

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2017-10-18 Thread Alvaro Herrera
This check is odd (tablecmds.c ATExecAttachPartition line 13861): /* Temp parent cannot have a partition that is itself not a temp */ if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP && attachrel->rd_rel->relpersistence != RELPERSISTENCE_TEMP) ereport(ERROR,

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2017-10-18 Thread Alvaro Herrera
Amit Langote wrote: > On 2017/10/18 1:52, Alvaro Herrera wrote: > > Alvaro Herrera wrote: > >> Robert Haas wrote: > >>> Implement table partitioning. > >> > >> Is it intentional that you can use ALTER TABLE OWNER TO on the parent > >> table, and that this does not recurse to modify the partitions'

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2017-10-17 Thread Amit Langote
On 2017/10/18 1:52, Alvaro Herrera wrote: > Alvaro Herrera wrote: >> Robert Haas wrote: >>> Implement table partitioning. >> >> Is it intentional that you can use ALTER TABLE OWNER TO on the parent >> table, and that this does not recurse to modify the partitions' owners? >> This doesn't seem to be

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2017-10-17 Thread Alvaro Herrera
Alvaro Herrera wrote: > Robert Haas wrote: > > Implement table partitioning. > > Is it intentional that you can use ALTER TABLE OWNER TO on the parent > table, and that this does not recurse to modify the partitions' owners? > This doesn't seem to be mentioned in comments nor documentation, so it

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2017-10-17 Thread Alvaro Herrera
Robert Haas wrote: > Implement table partitioning. Is it intentional that you can use ALTER TABLE OWNER TO on the parent table, and that this does not recurse to modify the partitions' owners? This doesn't seem to be mentioned in comments nor documentation, so it seems an oversight to me. Thought

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2017-10-13 Thread Robert Haas
On Fri, Oct 13, 2017 at 12:34 PM, Alvaro Herrera wrote: > Robert Haas wrote: >> Implement table partitioning. > >> Currently, tables can be range-partitioned or list-partitioned. List >> partitioning is limited to a single column, but range partitioning can >> involve multiple columns. A partiti

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2017-10-13 Thread Alvaro Herrera
Robert Haas wrote: > Implement table partitioning. > Currently, tables can be range-partitioned or list-partitioned. List > partitioning is limited to a single column, but range partitioning can > involve multiple columns. A partitioning "column" can be an > expression. I find the "partition st

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-22 Thread Robert Haas
On Wed, Dec 21, 2016 at 8:00 PM, Amit Langote wrote: > On 2016/12/22 0:31, Robert Haas wrote: >> On Tue, Dec 20, 2016 at 12:22 PM, Alvaro Herrera >> wrote: >>> Robert Haas wrote: Implement table partitioning. >>> >>> I thought it was odd to use rd_rel->reloftype as a boolean in >>> ATExecAtt

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-21 Thread Amit Langote
On 2016/12/22 0:31, Robert Haas wrote: > On Tue, Dec 20, 2016 at 12:22 PM, Alvaro Herrera > wrote: >> Robert Haas wrote: >>> Implement table partitioning. >> >> I thought it was odd to use rd_rel->reloftype as a boolean in >> ATExecAttachPartition, but apparently we do it elsewhere too, so let's >

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-21 Thread Robert Haas
On Tue, Dec 20, 2016 at 12:22 PM, Alvaro Herrera wrote: > Robert Haas wrote: >> Implement table partitioning. > > I thought it was odd to use rd_rel->reloftype as a boolean in > ATExecAttachPartition, but apparently we do it elsewhere too, so let's > leave that complaint for another day. Ugh. I

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-20 Thread Alvaro Herrera
Robert Haas wrote: > Implement table partitioning. I thought it was odd to use rd_rel->reloftype as a boolean in ATExecAttachPartition, but apparently we do it elsewhere too, so let's leave that complaint for another day. What I also found off in the same function is that we use SearchSysCacheCop

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-11 Thread Amit Langote
On 2016/12/10 7:55, Keith Fiske wrote: > Working on a blog post for this feature and just found some more > inconsistencies with the doc examples. Looks like the city_id column was > defined in the measurements table when it should be in the cities table. > The addition of the partition to the citi

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-10 Thread Jim Nasby
On 12/10/16 1:02 PM, Christophe Pettus wrote: On Dec 9, 2016, at 22:52, Keith Fiske wrote: On Fri, Dec 9, 2016 at 10:01 PM, Robert Haas wrote: One thing that's tricky/annoying about this is that if you have a DEFAULT partition and then add a partition, you have to scan the DEFAULT partition

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-10 Thread Christophe Pettus
> On Dec 9, 2016, at 22:52, Keith Fiske wrote: > On Fri, Dec 9, 2016 at 10:01 PM, Robert Haas wrote: >> One thing that's tricky/annoying about this is that if you have a >> DEFAULT partition and then add a partition, you have to scan the >> DEFAULT partition for data that should be moved to the

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-09 Thread Keith Fiske
On Fri, Dec 9, 2016 at 10:01 PM, Robert Haas wrote: > On Fri, Dec 9, 2016 at 5:55 PM, Keith Fiske wrote: > > Another suggestion I had was for handling when data is inserted that > doesn't > > match any defined child tables. Right now it just errors out, but in > > pg_partman I'd had it send the

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-09 Thread Robert Haas
On Fri, Dec 9, 2016 at 5:55 PM, Keith Fiske wrote: > Another suggestion I had was for handling when data is inserted that doesn't > match any defined child tables. Right now it just errors out, but in > pg_partman I'd had it send the data to the parent instead to avoid data > loss. I know that's n

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-09 Thread Keith Fiske
On Fri, Dec 9, 2016 at 1:23 PM, Keith Fiske wrote: > > > On Fri, Dec 9, 2016 at 1:13 PM, Amit Langote > wrote: > >> Hi Keith, >> >> On Sat, Dec 10, 2016 at 3:00 AM, Keith Fiske wrote: >> > Being that table partitioning is something I'm slightly interested in, >> > figured I'd give it a whirl. >

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-09 Thread Keith Fiske
On Fri, Dec 9, 2016 at 1:13 PM, Amit Langote wrote: > Hi Keith, > > On Sat, Dec 10, 2016 at 3:00 AM, Keith Fiske wrote: > > Being that table partitioning is something I'm slightly interested in, > > figured I'd give it a whirl. > > > > This example in the docs has an extraneous comma after the s

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-09 Thread Amit Langote
Hi Keith, On Sat, Dec 10, 2016 at 3:00 AM, Keith Fiske wrote: > Being that table partitioning is something I'm slightly interested in, > figured I'd give it a whirl. > > This example in the docs has an extraneous comma after the second column > > CREATE TABLE cities ( > name text not

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-09 Thread Keith Fiske
On Wed, Dec 7, 2016 at 1:30 PM, Robert Haas wrote: > On Wed, Dec 7, 2016 at 1:20 PM, Robert Haas wrote: > > Implement table partitioning. > > > -- > Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgs

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-08 Thread Stephen Frost
* Robert Haas (robertmh...@gmail.com) wrote: > On Thu, Dec 8, 2016 at 2:11 PM, Stephen Frost wrote: > > Yes, that makes the compiler warning go away. > > Great, pushed. Awesome, thanks! > > ... your compiler knows that key->partnatts will always be >= 1? > > :-) > > I think my compiler is too

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-08 Thread Robert Haas
On Thu, Dec 8, 2016 at 2:11 PM, Stephen Frost wrote: > Yes, that makes the compiler warning go away. Great, pushed. > ... your compiler knows that key->partnatts will always be >= 1? :-) I think my compiler is too dumb to notice that int x; printf("%d", x); is a reference to an uninitialized v

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-08 Thread Stephen Frost
Robert, * Robert Haas (robertmh...@gmail.com) wrote: > On Thu, Dec 8, 2016 at 1:49 PM, Stephen Frost wrote: > > * Robert Haas (rh...@postgresql.org) wrote: > >> Implement table partitioning. > > > > My compiler apparently doesn't care for this: > > > > .../src/backend/catalog/partition.c: In func

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-08 Thread Robert Haas
On Thu, Dec 8, 2016 at 1:49 PM, Stephen Frost wrote: > * Robert Haas (rh...@postgresql.org) wrote: >> Implement table partitioning. > > My compiler apparently doesn't care for this: > > .../src/backend/catalog/partition.c: In function ‘partition_rbound_cmp’: > .../src/backend/catalog/partition.c:1

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-08 Thread Stephen Frost
* Robert Haas (rh...@postgresql.org) wrote: > Implement table partitioning. My compiler apparently doesn't care for this: .../src/backend/catalog/partition.c: In function ‘partition_rbound_cmp’: .../src/backend/catalog/partition.c:1787:13: warning: ‘cmpval’ may be used uninitialized in this func

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-07 Thread Amit Langote
On 2016/12/08 3:33, Robert Haas wrote: > On Wed, Dec 7, 2016 at 1:30 PM, Robert Haas wrote: >> -- partitioned table cannot partiticipate in regular inheritance >> CREATE TABLE partitioned2 ( >> a int >> --- 392,411 >> c text, >> d text >> ) PARTITION BY RANGE (a oid_ops, plusone(b

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-07 Thread Robert Haas
On Wed, Dec 7, 2016 at 3:13 PM, Tom Lane wrote: > Robert Haas writes: >> And of course that'd be because relying on en_US isn't portable. Sigh. > > You can't rely on *any* collations other than C and POSIX. I get it; I just missed that during review, and then sent that message before I even loo

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-07 Thread Tom Lane
Robert Haas writes: > And of course that'd be because relying on en_US isn't portable. Sigh. You can't rely on *any* collations other than C and POSIX. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subs

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-07 Thread Robert Haas
On Wed, Dec 7, 2016 at 1:30 PM, Robert Haas wrote: > -- partitioned table cannot partiticipate in regular inheritance > CREATE TABLE partitioned2 ( > a int > --- 392,411 > c text, > d text > ) PARTITION BY RANGE (a oid_ops, plusone(b), c collate "default", d > collate "en_US"); >

Re: [HACKERS] [COMMITTERS] pgsql: Implement table partitioning.

2016-12-07 Thread Robert Haas
On Wed, Dec 7, 2016 at 1:20 PM, Robert Haas wrote: > Implement table partitioning. Well, that didn't take long to cause problems. The very first buildfarm machine to report after this commit is longfin, which is unhappy: *** *** 392,419 c text, d text ) PARTITION BY RANGE