"Vitaly" <vitaly(dot)yakunin(at)gmail(dot)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