BUG #3788: POSIX regexp seems doesn't work for '(?!re) ' pattern
The following bug has been logged online:
Bug reference: 3788
Logged by: Vitaly
Email address: vitaly.yakunin@gmail.com
PostgreSQL version: 8.3-beta3
Operating system: WinXP
Description: POSIX regexp seems doesn't work for '(?!re) ' pattern
Details:
SELECT author, type
FROM books WHERE "type" ~ '(?!novel)';
This select work incorrect. It returns all types.
Work around:
SELECT author, type
FROM books WHERE not ("type" ~ '(?=novel)');
"Vitaly" <vitaly.yakunin@gmail.com> writes:
SELECT author, type
FROM books WHERE "type" ~ '(?!novel)';
This select work incorrect. It returns all types.
Certainly. That's a negative-lookahead pattern and is therefore
guaranteed to match somewhere in every string (at the end, if
nowhere else).
regards, tom lane