1

I have one query, which returns different results on different servers.

select ' s' > '.'

First server return true, second - false. What the are the settings that can cause this?

1 Answer 1

1

Your DBs have different COLLATION:

The collation feature allows specifying the sort order and character classification behavior of data per-column, or even per-operation. This alleviates the restriction that the LC_COLLATE and LC_CTYPE settings of a database cannot be changed after its creation.

select name, setting
from pg_settings
where name in ('lc_collate', 'server_encoding', 'client_encoding');

-- explicit collation
select ' s' COLLATE "POSIX" > '.' COLLATE "POSIX"

SQLFiddle Demo

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.