Using ilike
In PostgreSQL, it is possible to perform a case-insensitive like
query by using the ilike
operator. In this situation, our query would become the following:
forumdb=> select * from categories where description ilike '%DISCUSS%';
pk | title | description
----+----------+------------------------------
1 | Database | Database related discussions
2 | Unix | Unix and Linux discussions
(2 rows)
This is the PostgreSQL way of solving the case-insensitive like
query issue that we encountered previously.