In H2 and Postgres, there is a data type that has an internal case-insensitive comparator. Changing the data type to that one and removing the call to ignoreCase() will solve the issue, since lower() no longer gets called on the output column.