Skip site navigation (1) Skip section navigation (2)

Re: partition text/varchar check problem -- solved

From: jamcito <jamcito(at)poczta(dot)fm>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: partition text/varchar check problem -- solved
Date: 2006-12-16 18:19:37
Message-ID: 458438B9.5050103@poczta.fm (view raw or flat)
Thread:
Lists: pgsql-performance
Tom Lane wrote:
>> CREATE TABLE data_a (CHECK (name LIKE varchar 'a%')
>> ) INHERITS (data);
>> --
>> CREATE TABLE data_b (CHECK (name LIKE varchar 'b%')
>> ) INHERITS (data);
> 
> That's not going to work because the planner is unable to prove anything
> about the behavior of LIKE --- there is nothing in the system that
> offers a relationship between the = operator and the LIKE operator.
> You'll need something like
> 
> 	CHECK (name >= 'a' AND name < 'b')
> 	CHECK (name >= 'b' AND name < 'c')
> 
> etc.  (These work for a query like "WHERE name = 'foo'" because
> the >= < and = operators are all members of the same btree opclass,
> so the planner knows how to reason about them.)
> 
> 			regards, tom lane

Thank you, it works!

Cheers,
jamcito

----------------------------------------------------------------------
Jestes kierowca? To poczytaj! >>> http://link.interia.pl/f199e


In response to

pgsql-performance by date

Next:From: Ireneusz PlutaDate: 2006-12-16 20:16:13
Subject: Re: partition text/varchar check problem
Previous:From: tsuraanDate: 2006-12-16 18:03:38
Subject: Re: Scaling concerns

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group