I think you haven't counted your quotes correctly. quote_literal() would probably help you build a valid ILIKE pattern with less pain. regards, tom lane
pgsql-hackers by date:
Соглашаюсь с условиями обработки персональных данных