Re: Is it possible to sort strings in EBCDIC order in PostgreSQLserver? - Mailing list pgsql-general

From Jeremy Schneider
Subject Re: Is it possible to sort strings in EBCDIC order in PostgreSQLserver?
Date
Msg-id d9ca5bf1-dd78-90a9-c7d6-d3d44372e08b@ardentperf.com
Whole thread Raw
In response to Re: Is it possible to sort strings in EBCDIC order in PostgreSQL server?  (Peter Geoghegan <pg@bowt.ie>)
List pgsql-general
On 12/12/17 10:21, Peter Geoghegan wrote:
> ICU supports creating custom collations that reorder upper and lower
> case, or digits with scripts (e.g. Latin alphabet characters). See the
> documentation -- "23.2.2.3.2. ICU collations". Advanced customization
> is possible.

I just gave this a try and I'm not sure I completely understand what
it's doing but it definitely doesn't look like it's sorting according to
EBCDIC byte orders. (This was on centos 7 with libicu-50.1.2) I might
have created the collation incorrectly. I'd love to hear if anyone else
finds a way to get this working outside of custom comparison operators.

pops-10.1 root@db1=# create collation "ebcdic" (provider=icu,
locale='cp037');
CREATE COLLATION

pops-10.1 root@db1=# create table test (data text);
CREATE TABLE

pops-10.1 root@db1=# insert into test
values('a'),('b'),('A'),('B'),('1'),('2'),('!'),('^');
INSERT 0 8

pops-10.1 root@db1=# select * from test order by data collate "ebcdic";
 data
------
 !
 ^
 1
 2
 a
 A
 b
 B
(8 rows)


-- 
http://about.me/jeremy_schneider


pgsql-general by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Any community members in Phoenix, AZ?
Next
From: "David G. Johnston"
Date:
Subject: Re: Any community members in Phoenix, AZ?