PostgreSQL String Comparison

I would like to make a request to get all elements with the string 'id'> the specified id.

The request select * from machine_thread where id > 'znRb1c_3TPytk-JoPX19Qw'returns an element with an identifierzT4GabH3Qy2W6YIGh8Ku-w

In other languages ​​that I use (python, javascript), string comparison will show that 'znRb1c_3TPytk-JoPX19Qw'more than 'zT4GabH3Qy2W6YIGh8Ku-w'. What does postgresql do differently, and is there anyway I can use the same comparison in all environments to compare row identifiers?

+5
source share
1 answer

It is because of the COLLATEuse of PostgreSQL.

Follow SHOW LC_COLLATEto find out which configuration you are using.

( python javascript) "C".

here

here

+4

All Articles