RE: Declarative Range Partitioning Postgres 11

2019-11-01 Thread Shatamjeev Dewan
Thanks a ton Michael From: Michael Lewis Sent: November-01-19 3:20 PM To: Shatamjeev Dewan Cc: pgsql-general Subject: Re: Declarative Range Partitioning Postgres 11 On Fri, Nov 1, 2019 at 9:22 AM Shatamjeev Dewan mailto:sde...@nbsps.com>> wrote: Hi Michael, I want to create a partit

Re: Declarative Range Partitioning Postgres 11

2019-11-01 Thread Michael Lewis
On Fri, Nov 1, 2019 at 9:22 AM Shatamjeev Dewan wrote: > Hi Michael, > > > > I want to create a partition by year and subpartition by month in postgres > 11 timestamp column. Please advise syntax. > https://www.postgresql.org/docs/11/ddl-partitioning.html The documentation is rather clear with

RE: Declarative Range Partitioning Postgres 11

2019-11-01 Thread Shatamjeev Dewan
Hi Michael, I want to create a partition by year and subpartition by month in postgres 11 timestamp column. Please advise syntax. Thanks, Shatamjeev From: Michael Lewis Sent: October-08-19 1:33 PM To: Shatamjeev Dewan Cc: pgsql-general Subject: Re: Declarative Range Partitioning Postgres 11

Re: Declarative Range Partitioning Postgres 11

2019-10-08 Thread Ron
On 10/8/19 12:33 PM, Michael Lewis wrote: On Tue, Oct 8, 2019 at 8:00 AM Shatamjeev Dewan > wrote: Hi Michael, In this case , I always need to include partition key(date)  in primary key ( if I have a primary key defined on non partition key column e.g i

RE: Declarative Range Partitioning Postgres 11

2019-10-08 Thread Shatamjeev Dewan
Thanks a lot Michael for invaluable advise . Appreciate your great help and support. From: Michael Lewis Sent: October-08-19 1:33 PM To: Shatamjeev Dewan Cc: pgsql-general Subject: Re: Declarative Range Partitioning Postgres 11 On Tue, Oct 8, 2019 at 8:00 AM Shatamjeev Dewan mailto:sde

Re: Declarative Range Partitioning Postgres 11

2019-10-08 Thread Michael Lewis
On Tue, Oct 8, 2019 at 8:00 AM Shatamjeev Dewan wrote: > Hi Michael, > > > > In this case , I always need to include partition key(date) in primary > key ( if I have a primary key defined on non partition key column e.g id > (in my case), to make it a composite primary key (id, date). This would

Re: Declarative Range Partitioning Postgres 11

2019-10-08 Thread Michael Lewis
On Mon, Oct 7, 2019 at 5:56 PM Ron wrote: > On 10/7/19 6:17 PM, Michael Lewis wrote: > > No, what you want is not possible and probably won't ever be I would > expect. > > Sure it is. Maybe not the (weird) way that Postgres does partitioning, > but > the legacy RDBMS that I still occasionally ma

RE: Declarative Range Partitioning Postgres 11

2019-10-08 Thread Shatamjeev Dewan
. Thanks, Shatamjeev From: Michael Lewis Sent: October-07-19 7:18 PM To: Shatamjeev Dewan Cc: pgsql-general Subject: Re: Declarative Range Partitioning Postgres 11 No, what you want is not possible and probably won't ever be I would expect. Scanning every partition to validate the primar

RE: Declarative Range Partitioning Postgres 11

2019-10-08 Thread Shatamjeev Dewan
Thanks Michael. From: Michael Lewis Sent: October-07-19 7:18 PM To: Shatamjeev Dewan Cc: pgsql-general Subject: Re: Declarative Range Partitioning Postgres 11 No, what you want is not possible and probably won't ever be I would expect. Scanning every partition to validate the primar

Re: Declarative Range Partitioning Postgres 11

2019-10-07 Thread Ron
On 10/7/19 6:17 PM, Michael Lewis wrote: No, what you want is not possible and probably won't ever be I would expect. Sure it is.  Maybe not the (weird) way that Postgres does partitioning, but the legacy RDBMS that I still occasionally maintain has for at least 25 years had partition key ind

Re: Declarative Range Partitioning Postgres 11

2019-10-07 Thread Michael Lewis
No, what you want is not possible and probably won't ever be I would expect. Scanning every partition to validate the primary key isn't scalable.

Declarative Range Partitioning Postgres 11

2019-10-07 Thread Shatamjeev Dewan
Hi, I am trying to create a table in postgres 11 with timestamp column as a partition key using PARTITION BY RANGE (create_dtt). The table definition has also an id column which is a primary key. ERROR: insufficient columns in PRIMARY KEY constraint definition DETAIL: PRIMARY KEY constraint