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

From Tom Lane
Subject Re: Is it possible to sort strings in EBCDIC order in PostgreSQL server?
Date
Msg-id 22976.1513003579@sss.pgh.pa.us
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>)
List pgsql-general
"Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com> writes:
> 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. 

> I see almost no hope from the following, but let me make sure.
> https://www.postgresql.org/message-id/flat/28548.1424884373%40sss.pgh.pa.us#28548.1424884373@sss.pgh.pa.us

> "Hmm ... EBCDIC ... is that mandatory?  Because there are a pretty large
> number of ASCII dependencies in PG, mostly arising from our support of
> multibyte character sets, which are all expected to be ASCII supersets.
> If there's not a way to run the server process in ASCII-land, you're
> likely dead in the water.  I would not want to try to ferret out all
> the dependencies."

As I recall, that question was about converting the server to use
EBCDIC strings everywhere.  That seems impractical for the reasons
I mentioned.  But you could probably sort according to EBCDIC order
if you were willing to accept some inefficiency: internal to the
comparison function, convert each string to EBCDIC on each call.

Another way you could imagine is to store EBCDIC strings embedded
in bytea values.

            regards, tom lane


pgsql-general by date:

Previous
From: Ray Stell
Date:
Subject: PostgreSQL is so hip again
Next
From: Tom Lane
Date:
Subject: Re: Removing INNER JOINs