Subtle but Important Difference With PostgreSQL

July 21, 2005

Here's something I ran into while doing some querying of the BillBoards database: PostgreSQL's LIKE operator acts differently than others that I'm used to. Both MySQL and SQLServer perform case insensitive matches, but not PostgreSQL. Searches for "bob" won't return "Bob," for instance. I've been trying to maintain as much compatibility with MySQL as I could. I even went so far as to create a stored procedure to mimic a MySQL date function. But, using PostgreSQL's proprietary ILIKE operator will cause errors in other databases.