pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Is it possible to sort strings in EBCDIC order in PostgreSQL server?
Date: Mon, 11 Dec 2017 09:46:19 -0500
Message-ID: <22976.1513003579@sss.pgh.pa.us> (raw)
In-Reply-To: <0A3221C70F24FB45833433255569204D1F84A7AD@G01JPEXMBYT05>
References: <0A3221C70F24FB45833433255569204D1F84A7AD@G01JPEXMBYT05>

"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 the PostgreSQL server?  i.e. is it possible to use EBCDIC collation in PostgreSQL, say, by using ICU or something?  We need to 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...

> "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




view thread (15+ messages)  latest in thread

Message-ID: <22976.1513003579@sss.pgh.pa.us>
Permalink:  ../22976.1513003579@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22976.1513003579@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, tsunakawa.takay@jp.fujitsu.com
  Subject: Re: Is it possible to sort strings in EBCDIC order in PostgreSQL server?
  In-Reply-To: <22976.1513003579@sss.pgh.pa.us>
  References: <0A3221C70F24FB45833433255569204D1F84A7AD@G01JPEXMBYT05> <22976.1513003579@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox