Harshel Mike

Posted on 27th February 2024|220 views


Postgresql Like Case Insensitive

Which is better ILIKE or Case_insensitive query in PostgreSQL?

naseer mohammad

Posted on 27th February 2024

  • According to active spot, instead of LIKE you can use ILIKE PostgreSQL, you can understand that ILIKE can be used to change the case from upper to lower or vice versa. Still, by using ILIKE, you can see that the ILIKE is a slower process, now let us assume that ILIKE used for extended expressions then it consumes a lot of time. So, to overcome this, it is wise to use LOWER() Function, which is way faster than the ILIKE function. 


SELECT id FROM groups where name ILIKE 'name.'

Hence, you can use this, but this is way slower than case_insensitive query.

  • Case_insensitive query used to change the case of the name as required from lower to upper or vice versa. Moreover, this is faster as compared to ILIKE and LIKE.


SELECT id FROM groups WHERE LOWER(name) = 'name';


Write your answer


Get a Live FREE Demo
  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos