pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jimmy Thrasher <jimmy@jimmythrasher.com>
To: Adrian Klaver <adrian.klaver@aklaver.com>
To: pgsql-general@postgresql.org
Subject: Re: Unexpected behavior sorting strings
Date: Wed, 08 Apr 2020 12:08:27 -0400
Message-ID: <3774568d-8ac8-4f02-95af-7bd78a23b15c@www.fastmail.com> (raw)
In-Reply-To: <a0bfe027-41e9-5222-d090-7fd7abb006aa@aklaver.com>
References: <410dddd6-bc66-48ca-ab9d-13889d94b62c@www.fastmail.com>
	<a0bfe027-41e9-5222-d090-7fd7abb006aa@aklaver.com>

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





view thread (4+ messages)

Message-ID: <3774568d-8ac8-4f02-95af-7bd78a23b15c@www.fastmail.com>
Permalink:  ../3774568d-8ac8-4f02-95af-7bd78a23b15c@www.fastmail.com/
Also on:    postgresql.org/message-id/3774568d-8ac8-4f02-95af-7bd78a23b15c@www.fastmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: jimmy@jimmythrasher.com, adrian.klaver@aklaver.com
  Subject: Re: Unexpected behavior sorting strings
  In-Reply-To: <3774568d-8ac8-4f02-95af-7bd78a23b15c@www.fastmail.com>
  References: <410dddd6-bc66-48ca-ab9d-13889d94b62c@www.fastmail.com> <a0bfe027-41e9-5222-d090-7fd7abb006aa@aklaver.com> <3774568d-8ac8-4f02-95af-7bd78a23b15c@www.fastmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox