Re: BUG #2127: Regular Expression Limits Do Not Work

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Kyril Alyoshin" <kyrill(at)technolog(dot)ca>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2127: Regular Expression Limits Do Not Work
Date: 2005-12-27 15:22:28
Message-ID: 23077.1135696948@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Kyril Alyoshin" <kyrill(at)technolog(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2005-12-27 15:24:12 Re: BUG #2126: Index usage for function value
Previous Message Tom Lane 2005-12-27 15:20:52 Re: BUG #2102: Backend reports wrong number of affected rows for a