Re: [GENERAL] constraint checking on partitions

2009-07-09 Thread Chris Spotts
> > > If I ran a select * from A where date1 >= '2009-07-02' and date1 < > > '2009-07-15' then I would think it wouldn't check O. > [Spotts, Christopher] I oversimplified this too much - but I figured out what was happening. If you added the June table as well and added a separate NOT constrain

Re: [GENERAL] constraint checking on partitions

2009-07-09 Thread Tom Lane
"Chris Spotts" writes: > I mistyped, that should be > alter table D add constraint onlyjuly check (date1 >= '2009-07-01' and date1 > < '2009-08-01') > Then this is also run > alter table O add constraint notjuly check (NOT(date1 >= '2009-07-01' and > date1 < '2009-08-01')) > If I ran a select *

Re: [GENERAL] constraint checking on partitions

2009-07-09 Thread Chris Spotts
> -Original Message- > From: Tom Lane [mailto:t...@sss.pgh.pa.us] > Sent: Thursday, July 09, 2009 1:52 PM > To: Chris Spotts > Cc: 'postgres list' > Subject: Re: [GENERAL] constraint checking on partitions > > "Chris Spotts" writes: > &

Re: [GENERAL] constraint checking on partitions

2009-07-09 Thread Tom Lane
"Chris Spotts" writes: > Then this is also run > alter table O add constraint notjuly check (NOT(date1 >= '2009-07-01' and > date1 < '2009-07-01')) > The planner excludes correctly except that it always checks O. What are the actual queries you're hoping it will exclude for?

[GENERAL] constraint checking on partitions

2009-07-09 Thread Chris Spotts
I have several partitions on a history table that are partitioned by a date range (monthly). However, it's possible for an unexpected but valid date (either very far in the future or very far in the past) to come in the data set and so there is an "overflow" table. Say table A is parent, B is Ap