Here I'm using postgres 9.6 And PFA is my table schema for postgres
id username
----------
1 ashesh
2 123456
While doing a query on a username with '123456' it will not gives the response but when doing a query with 'ashesh' it will give a response. My query is
select * from customer where username = '123456';
Gives me a blank response but while querying with 'ashesh'
select * from customer where username = 'ashesh';
it will give the response.
where username like '123456%'work? Do you have an unique index on that column? What is your exact Postgres version (select version()will tell you).