In my Spring Boot app, I use @Query
as shown below on PostgreSQL and compare name value case-insensitive:
@Query(value = "SELECT DISTINCT e.id, e.name FROM Employee e " +
"WHERE e.name ILIKE :name) ",
nativeQuery = true)
List<Recipe> getEmployees(@Param("name") String name);
Although it seems to be ok for some time, it cannot return the same result randomly and it continues after rebuilding app and restarting. But it is working when executing the same query on DBeaver.
So, how should I compare equality of name field case insensitively in PostgreSQL?