I am new to postrges and want to sort varchar type columns. want to explain the problem with with below example:
table name: testsorting
order
I agree with Clodoaldo Neto's answer, but also don't forget to add the index
CREATE INDEX testsorting_name on testsorting(upper(left(name,1)), substring(name from 2)::integer)