Re: Unexpected behavior sorting strings - Mailing list pgsql-general

From Tom Lane
Subject Re: Unexpected behavior sorting strings
Date
Msg-id 30446.1586360871@sss.pgh.pa.us
Whole thread Raw
In response to Unexpected behavior sorting strings  ("Jimmy Thrasher" <jimmy@jimmythrasher.com>)
List pgsql-general
"Jimmy Thrasher" <jimmy@jimmythrasher.com> writes:
> As I understand it, postgresql sorts strings roughly like strcmp does: character by character based on encoding
value.

Only if you're using C locale.  Other locales such as en_US have
completely different rules, which most hackers tend to find pretty
unintelligible and inconsistent :-(.  In your example, I think
the first-pass sort is on just the letters, and only if those are
the same will it consider the punctuation.

            regards, tom lane



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Best method to display table information in predefined formats
Next
From: Adrian Klaver
Date:
Subject: Re: Unexpected behavior sorting strings