Re: BUG #2127: Regular Expression Limits Do Not Work - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #2127: Regular Expression Limits Do Not Work
Date
Msg-id 23077.1135696948@sss.pgh.pa.us
Whole thread Raw
In response to BUG #2127: Regular Expression Limits Do Not Work  ("Kyril Alyoshin" <kyrill@technolog.ca>)
List pgsql-bugs
"Kyril Alyoshin" <kyrill@technolog.ca> writes:
> IF (NEW.postal_code_name !~ '\\d{5}')

> The bug description is:
> If postal_code_name is > 5 digits, the expression would still evaluate to
> false, and the error will not be raised.

> Please correct this.

Please learn how to use regular expressions ;-)

You probably want '^\\d{5}$' instead, to require the regex to match the
whole string instead of just any part of it.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #2102: Backend reports wrong number of affected rows for a
Next
From: Tom Lane
Date:
Subject: Re: BUG #2126: Index usage for function value