Add formatting to first arguments in Query Conditions: PostgreSQL search case

There already was a complaint about PostgreSQL case-sensitive search. If you type “peter”, it won’t return Peter.

I found an ugly workaround which might help in most cases. For every field to check against the search, you should compare with the variable and with its capitalied version. So it will check against “peter” and “Peter”.

The con of this is if there’s a second word, as it is not getting capitalized.

The things would be much easier if flollowing this advice, we could use coding and formatting the left part as well:

WHERE LOWER(users.first_name ) = LOWER('%_GET.name')

Then we would compare strings not worring about the case.

Community Page
Last updated: