I was comparing the speeds of several databases, working with some randomly generated strings and curiously noticed the sorting differed. I am working with thousands of rows but have isolated my data to just these 2 strings for simplicity:
Pazyn Qhhbltw Vxsnwgt
Pazynkfc Tttzqjss Zzpxuarhy
Mongo and MySQL both sort them in the order displayed above, but Postgres switches them around. It seems that the space character is considered to be before "k" by both Mongo and MySQL but after it by Postgres.
How can I get Postgres to fall-in and be consistent with MySQL and Mongo?
I am using Postgres version 10.10 and MySQL 8.0.18.
Both columns are varchar(32) with no specific collation specified so I presume they are using default.
I've tried both with and without an index and I've tried several types of collation on the index but still get the same result.
I'm not sure how to debug this.