Re: partition text/varchar check problem -- solved

Поиск
Список
Период
Сортировка
От jamcito
Тема Re: partition text/varchar check problem -- solved
Дата
Msg-id 458438B9.5050103@poczta.fm
обсуждение исходный текст
Ответ на Re: partition text/varchar check problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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


В списке pgsql-performance по дате отправления:

Предыдущее
От: tsuraan
Дата:
Сообщение: Re: Scaling concerns
Следующее
От: Ireneusz Pluta
Дата:
Сообщение: Re: partition text/varchar check problem