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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #2127: Regular Expression Limits Do Not Work
Дата
Msg-id 23077.1135696948@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #2127: Regular Expression Limits Do Not Work  ("Kyril Alyoshin" <kyrill@technolog.ca>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2102: Backend reports wrong number of affected rows for a
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2126: Index usage for function value