I'm using Postgresql 9.4.5. When I go to psql and run \l
I get
Encoding is UTF8
Collate is en_US.UTF-8
cCtype is en_US.UTF-8
I have products
table with a name
column that has the following names:
T-700A Grouped
T-700 AGrouped
T-700A Halved
T-700 Whole
When I execute the following SQL in pql
SELECT name FROM products WHERE name LIKE '%T-700%' ORDER By name ASC;
I get the following output
T-700A Grouped
T-700 AGrouped
T-700A Halved
T-700 Whole
That sorting doesn't look natural. I expected to get
T-700 AGrouped
T-700 Whole
T-700A Grouped
T-700A Halved
It doesn't seem like Postgres is handling spaces the way I expected. Can anyone explain what is happening and suggest a way to fix this?