Re: Is it possible to sort strings in EBCDIC order in PostgreSQL server?

From: James Keener <jim(at)jimkeener(dot)com>
To: John McKown <john(dot)archie(dot)mckown(at)gmail(dot)com>
Cc: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is it possible to sort strings in EBCDIC order in PostgreSQL server?
Date: 2017-12-12 15:43:02
Message-ID: CAG8g3tzx1_qCnkGgCubk_ktUoQRyc3w08tkBd=dOxVhDSdBLEw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sorry for spamming the list. It appears that I'm an idiot. Sorry :(

jim=# select * from test order by a collate "C";
a
----------------------
12 Days of Christmas
12 drummers
Anne
Isaac
Jim
a
aardvark
b
island
job
(10 rows)

jim=# select * from test order by a collate "en_US.utf8";
a
----------------------
12 Days of Christmas
12 drummers
a
aardvark
Anne
b
Isaac
island
Jim
job
(10 rows)

On Tue, Dec 12, 2017 at 10:36 AM, James Keener <jim(at)jimkeener(dot)com> wrote:

> en_US.utf8. is still 0-9A-Za-z and in my example set (as it's my default
> too :))
>
> You'd need a case insensitive collation to do what you described, and I'm
> not sure those exist in postgres. (I guess you could always build your own
> if you _really_ wanted to.
>
> Jim
>
> On Tue, Dec 12, 2017 at 10:24 AM, John McKown <
> john(dot)archie(dot)mckown(at)gmail(dot)com> wrote:
>
>> On Tue, Dec 12, 2017 at 9:11 AM, James Keener <jim(at)jimkeener(dot)com> wrote:
>>
>>> The default C locale on Linux (I don't know Windows) will sort "digits",
>>>> then alphabetic with the lower then upper case of each letter in order
>>>> like: "aAbB...zZ"
>>>>
>>>
>>> That's no true at all! The C locales are 0-9A-Za-z
>>>
>>
>> ​Thanks for the correction. Turns out that I forgot that my default
>> locale on Linux was en_US.utf8.​
>>
>>
>> --
>> I have a theory that it's impossible to prove anything, but I can't prove
>> it.
>>
>> Maranatha! <><
>> John McKown
>>
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John McKown 2017-12-12 15:47:28 Re: Is it possible to sort strings in EBCDIC order in PostgreSQL server?
Previous Message James Keener 2017-12-12 15:36:42 Re: Is it possible to sort strings in EBCDIC order in PostgreSQL server?