Re: [GENERAL] Constraint exclusion issue

2010-01-17 Thread Jeff Davis
On Sun, 2010-01-17 at 21:48 +0100, Mathieu De Zutter wrote: > Can you explain this then: > OK: select * from parent where (c,n) = ('b',0); > NOT OK: select * from parent where (c,n)::y = ('b',0)::y; Once you pass (c,n) into the cast, you get out something new that's neither c nor n. It's as if you

Re: [GENERAL] Constraint exclusion issue

2010-01-17 Thread Mathieu De Zutter
On Sun, Jan 17, 2010 at 8:06 PM, Jeff Davis wrote: > On Sat, 2010-01-16 at 19:02 +0100, Mathieu De Zutter wrote: >> Hi, >> >> I'm trying to make constraint exclusion work correctly in a query with >> only one parameter, but I have some issues. >> Please have a look at the scenario below and tell m

Re: [GENERAL] Constraint exclusion issue

2010-01-17 Thread Jeff Davis
On Sat, 2010-01-16 at 19:02 +0100, Mathieu De Zutter wrote: > Hi, > > I'm trying to make constraint exclusion work correctly in a query with > only one parameter, but I have some issues. > Please have a look at the scenario below and tell me how I can improve it. > ... > shs-dev=# explain selec

Re: [GENERAL] Constraint exclusion issue

2010-01-17 Thread Emanuel Calvo Franco
2010/1/16 Mathieu De Zutter : > On Sat, Jan 16, 2010 at 7:26 PM, Scott Marlowe > wrote: >> On Sat, Jan 16, 2010 at 11:02 AM, Mathieu De Zutter >> wrote: >>> shs-dev=# explain select * from parent where (c,n) = '("b",0)'; >>> ERROR:  input of anonymous composite types is not implemented >> >> Sho

Re: [GENERAL] Constraint exclusion issue

2010-01-16 Thread Mathieu De Zutter
On Sat, Jan 16, 2010 at 7:26 PM, Scott Marlowe wrote: > On Sat, Jan 16, 2010 at 11:02 AM, Mathieu De Zutter > wrote: >> shs-dev=# explain select * from parent where (c,n) = '("b",0)'; >> ERROR:  input of anonymous composite types is not implemented > > Shouldn't that be 'b' not "b" ? It is speci

Re: [GENERAL] Constraint exclusion issue

2010-01-16 Thread Scott Marlowe
On Sat, Jan 16, 2010 at 11:02 AM, Mathieu De Zutter wrote: > Hi, > > I'm trying to make constraint exclusion work correctly in a query with > only one parameter, but I have some issues. > Please have a look at the scenario below and tell me how I can improve it. > > Thanks! > > > -- I create an in

[GENERAL] Constraint exclusion issue

2010-01-16 Thread Mathieu De Zutter
Hi, I'm trying to make constraint exclusion work correctly in a query with only one parameter, but I have some issues. Please have a look at the scenario below and tell me how I can improve it. Thanks! -- I create an inheritance relationship with a check constraint in the child shs-dev=# creat