pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jamcito <jamcito@poczta.fm>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: partition text/varchar check problem -- solved
Date: Sat, 16 Dec 2006 19:19:37 +0100
Message-ID: <458438B9.5050103@poczta.fm> (raw)
In-Reply-To: <29283.1166284128@sss.pgh.pa.us>
References: <458402D4.7080500@poczta.fm>
	<29283.1166284128@sss.pgh.pa.us>

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




Message-ID: <458438B9.5050103@poczta.fm>
Permalink:  ../458438B9.5050103@poczta.fm/
Also on:    postgresql.org/message-id/458438B9.5050103@poczta.fm

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: jamcito@poczta.fm, tgl@sss.pgh.pa.us
  Subject: Re: partition text/varchar check problem -- solved
  In-Reply-To: <458438B9.5050103@poczta.fm>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox