I currently have the query running on Postgres:
SELECT * FROM addenda.users WHERE users.username LIKE '%\_'
But rather then returning just entries ending in an underscore, I get all results back, regardless of whether it contains an underscore or not.
Running the query below returns a username which is just an underscore, so the escaping does work:
SELECT * FROM addenda.users WHERE users.username LIKE '\_'
And running the query below returns a username which ends with a specific letter (s):
SELECT * FROM addenda.users WHERE users.username LIKE '%s'
What am I doing wrong?