Query related to alter table ... attach partition

2018-01-22 Thread Ashutosh Sharma
Hi All, I have created a regular table with CHECK constraint on the partition key column and it conflicts with the partition constraint but, still, i could attach the table with the partitioned table. Here is what i am trying to do, postgres[76308]=# create table part_tab (b int, a int) partition

Re: Query related to alter table ... attach partition

2018-01-22 Thread Amit Langote
On 2018/01/23 14:35, Ashutosh Sharma wrote: > I have created a regular table with CHECK constraint on the partition > key column and it conflicts with the partition constraint but, still, > i could attach the table with the partitioned table. Here is what i am > trying to do, > > postgres[76308]=#

Re: Query related to alter table ... attach partition

2018-01-22 Thread Ashutosh Sharma
On Tue, Jan 23, 2018 at 11:49 AM, Amit Langote wrote: > On 2018/01/23 14:35, Ashutosh Sharma wrote: >> I have created a regular table with CHECK constraint on the partition >> key column and it conflicts with the partition constraint but, still, >> i could attach the table with the partitioned tab

Re: Query related to alter table ... attach partition

2018-01-22 Thread Amit Langote
On 2018/01/23 15:55, Ashutosh Sharma wrote: >> However, we don't make it fail because the table has a constraint that >> contradicts the partition constraint. Attach succeeds in the absence of >> any violating rows and the end result is that the table/partition has >> contradictory constraints (th

Re: Query related to alter table ... attach partition

2018-01-28 Thread Ashutosh Bapat
On Tue, Jan 23, 2018 at 12:25 PM, Ashutosh Sharma wrote: >> > > That's right. But, shouldn't a partition that not at all fall in the > partition range be rejected when user tries to attach it. I feel we > should at least try throwing a WARNING message for it. Thoughts? > One can add constraints c