Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group