Re: - Mailing list pgsql-bugs

From Tom Lane
Subject Re:
Date
Msg-id 19284.962635870@sss.pgh.pa.us
Whole thread Raw
In response to ...  ("Alexei A.Romanenko" <A.A.Romanenko@inp.nsk.su>)
List pgsql-bugs
"Alexei A.Romanenko" <A.A.Romanenko@inp.nsk.su> writes:
> It seems to me there is a problem with regular expressions.
> When i create table and try to insert some restriction for
> a fields, system accept it. Then, whem i insert something, which
> dont match to regexp, it inserted anyway or backwards.

No bug there.  You've forgotten that a char(N) field value will be
space-padded to N characters.  For variable-length strings you
ought to be using varchar(N) instead.  If you really want to use
char(N), you can match with regexps like 'foo *$'.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: \d* won't work in 7.0.2?
Next
From: Tom Lane
Date:
Subject: Re: joins on the same table with aggregates