ILIKE is a PostgreSQL-specific operator that functions like LIKE but ignores letter case by internally applying a case-insensitive collation. It evaluates to a Boolean and is most often used in WHERE clauses to filter rows whose text column matches a supplied pattern containing wildcard characters. Supported wildcards are % (any sequence of characters, including zero) and _ (any single character). You can optionally specify a custom escape character with the ESCAPE clause to treat % or _ as literals. Because ILIKE bypasses indexes that use the default case-sensitive collation, performance may degrade on large tables unless you add a functional index on lower(column) or use a case-insensitive collation index in PostgreSQL 12+. Unlike LIKE, ILIKE is not in the SQL standard and is unavailable in most other database systems.
expression
(string) - The text value to compare.pattern
(string) - The pattern including % and _ wildcards.escape_character
(optional char) - Single character that escapes % or _ inside the pattern.LIKE, SIMILAR TO, LOWER(), UPPER(), COLLATE, GIN trigram indexes
PostgreSQL 6.4
LIKE is case-sensitive under a case-sensitive collation, whereas ILIKE ignores case entirely.
Not by default. Create a functional index on lower(column) or a case-insensitive collation index to improve speed.
Add an ESCAPE clause and prefix the percent sign with the escape character, for example: `WHERE col ILIKE '%25' ESCAPE '\';`.
PostgreSQL automatically casts varchar, char, and text. Cast other types (e.g., `::text`) before using ILIKE.