Re: Unexpected behavior sorting strings

From: "Jimmy Thrasher" <jimmy(at)jimmythrasher(dot)com>
To: "Adrian Klaver" <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Unexpected behavior sorting strings
Date: 2020-04-08 16:08:27
Message-ID: 3774568d-8ac8-4f02-95af-7bd78a23b15c@www.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Many thanks! That clarifies things well.

Jimmy

On Wed, Apr 8, 2020, at 11:49 AM, Adrian Klaver wrote:
> On 4/8/20 7:35 AM, Jimmy Thrasher wrote:
<snip>
> > Am I missing something about how sorting works?
>
> I believe you are looking for 'C' collation:
>
> test=# select unnest(array[('> N' collate "C") , ('< S' COLLATE "C")])
> as s order by s;
>
> s
> -----
> < S
> > N
> (2 rows)
>
>
> For more information see:
>
> https://www.postgresql.org/docs/12/collation.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Roberto Della Pasqua 2020-04-08 17:28:45 full text
Previous Message Stephen Frost 2020-04-08 15:54:34 Re: Using of --data-checksums