Re: [GENERAL] Constraint exclusion issue

2010-01-17 Thread Emanuel Calvo Franco
2010/1/16 Mathieu De Zutter math...@dezutter.org: On Sat, Jan 16, 2010 at 7:26 PM, Scott Marlowe scott.marl...@gmail.com wrote: On Sat, Jan 16, 2010 at 11:02 AM, Mathieu De Zutter math...@dezutter.org wrote: shs-dev=# explain select * from parent where (c,n) = '(b,0)'; ERROR:  input of

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 select *

Re: [GENERAL] Constraint exclusion issue

2010-01-17 Thread Mathieu De Zutter
On Sun, Jan 17, 2010 at 8:06 PM, Jeff Davis pg...@j-davis.com 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

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

[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=#

Re: [GENERAL] Constraint exclusion issue

2010-01-16 Thread Scott Marlowe
On Sat, Jan 16, 2010 at 11:02 AM, Mathieu De Zutter math...@dezutter.org 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

Re: [GENERAL] Constraint exclusion issue

2010-01-16 Thread Mathieu De Zutter
On Sat, Jan 16, 2010 at 7:26 PM, Scott Marlowe scott.marl...@gmail.com wrote: On Sat, Jan 16, 2010 at 11:02 AM, Mathieu De Zutter math...@dezutter.org wrote: shs-dev=# explain select * from parent where (c,n) = '(b,0)'; ERROR:  input of anonymous composite types is not implemented Shouldn't