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

From Peter Geoghegan
Subject Re: Is it possible to sort strings in EBCDIC order in PostgreSQL server?
Date
Msg-id CAH2-Wzkoc3pD3SR=MA=W4FyHFicDypcw2NGUEZDdWbODHiTbKg@mail.gmail.com
Whole thread Raw
In response to Is it possible to sort strings in EBCDIC order in PostgreSQL server?  ("Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>)
Responses RE: Is it possible to sort strings in EBCDIC order in PostgreSQLserver?
List pgsql-general
On Sun, Dec 10, 2017 at 11:09 PM, Tsunakawa, Takayuki
<tsunakawa.takay@jp.fujitsu.com> wrote:
> It is embarrassing to ask such a thing, but is there any way to sort character column values in EBCDIC order inside
thePostgreSQL server?  i.e. is it possible to use EBCDIC collation in PostgreSQL, say, by using ICU or something?  We
needto run on a certain mainframe. 

There is no need for embarrassment. I think that you mean that you'd
like to get behavior equivalent to the "C" locale with an EBCDIC
encoding. Right? I think that you could use ICU to do this with some
work. ICU collations are not tied to a particular encoding, unlike the
libc collations (they support most but not all collations).

That said, the idea of an "EBCDIC collation" seems limiting. Why
should a system like DB2 for the mainframe (that happens to use EBCDIC
as its encoding) not have a more natural, human-orientated collation
even while using EBCDIC? ISTM that the point of using the "C" locale
(with EBDIC or with UTF-8 or with any other encoding) is to get a
performance benefit where the actual collation's behavior doesn't
matter much to users. Are you sure it's really important to be
*exactly* compatible with EBCDIC order? As long as you're paying for a
custom collation, why not just use a collation that is helpful to
humans?

--
Peter Geoghegan


pgsql-general by date:

Previous
From: Andreas Kretschmer
Date:
Subject: Re: How to know if a database has changed
Next
From: Paul Ramsey
Date:
Subject: SearchSysCache() tutorial?