Phoenix Kiula <phoenix.kiula@gmail.com> writes:
> I am using this SQL:
> SELECT id FROM table1
> WHERE mytext ~* E'sub1|sub2|sub3|sub4...'
> LIMIT 10;
> This is basically working, but some of the "mytext" columns being
> returned that do not contain any of these substrings.
[ raised eyebrow... ] Could we see a concrete example?
One potential issue is that, depending on which PG version and locale
and database encoding you are using, case-insensitive matching might
not work properly on non-ASCII letters. Other than that, the only
gotcha I can think of is having regexp special characters in the
substrings and failing to escape them properly.
regards, tom lane