RE: BUG #15651: Collation setting en_US.utf8 breaking sort order

From: Kaleb Akalework <kaleb(dot)akalework(at)asg(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: RE: BUG #15651: Collation setting en_US.utf8 breaking sort order
Date: 2019-02-22 18:18:16
Message-ID: 4ce38aace626460e85ed2abe0051371c@asg.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

--> Really? AFAIK, Windows doesn't support collation names that look like that.
I meant to say Linux. Not Windows.

-----Original Message-----
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Sent: Friday, February 22, 2019 1:03 PM
To: Kaleb Akalework <kaleb(dot)akalework(at)asg(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15651: Collation setting en_US.utf8 breaking sort order

*** External email: Verify sender before opening attachments or links ***

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> I have PostgresSQL database on Windows. I created database with
> Collation of en_US.utf8.

Really? AFAIK, Windows doesn't support collation names that look like that.

> Then I created table (The steps to reproduce are below). I inserted a
> few rows into this table one of which was row with special characters
> "~!(at)#$^&(". The insert worked fine but then when I do a select on the
> column for values >=' ' (Space), I get back all the rows except for
> the row that contains "~!(at)#$^&(" .

This appears to be the intended behavior of en_US sorting.
On a Linux machine I can reproduce it outside Postgres:

$ LANG=C sort stuff.txt

AAA
BAA
CAA
DAA
~!(at)#$^&(
$ LANG=en_US sort stuff.txt
~!(at)#$^&(

AAA
BAA
CAA
DAA

(The first line in my test file contains one space.)

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Geoghegan 2019-02-22 18:40:58 Re: BUG #15651: Collation setting en_US.utf8 breaking sort order
Previous Message Tom Lane 2019-02-22 18:03:26 Re: BUG #15651: Collation setting en_US.utf8 breaking sort order