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

From: Jeremy Schneider <schneider(at)ardentperf(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Is it possible to sort strings in EBCDIC order in PostgreSQL server?
Date: 2018-01-24 00:08:40
Message-ID: d9ca5bf1-dd78-90a9-c7d6-d3d44372e08b@ardentperf.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)db1=# create collation "ebcdic" (provider=icu,
locale='cp037');
CREATE COLLATION

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

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

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

--
http://about.me/jeremy_schneider

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2018-01-24 00:35:24 Re: Any community members in Phoenix, AZ?
Previous Message Joshua D. Drake 2018-01-23 23:14:13 Any community members in Phoenix, AZ?