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

From James Keener
Subject Re: Is it possible to sort strings in EBCDIC order in PostgreSQL server?
Date
Msg-id CAG8g3txKiJjJpYnvHMzdghdTvCCkgJ5izKAvxzuXwJeYEHeybA@mail.gmail.com
Whole thread Raw
In response to Re: Is it possible to sort strings in EBCDIC order in PostgreSQL server?  (John McKown <john.archie.mckown@gmail.com>)
List pgsql-general
If that's the case, I wonder if OP could write a function that would convert from the ASCII code-point ot the EBCDIC codepoint. For instance, (using the function at https://wiki.postgresql.org/wiki/Binary_Replace) convert A to char 193, `select binary_replace('Anne'::bytea, 'A'::bytea, '\xc1'::bytea);` and then sort by the result of this function.

Jim

On Tue, Dec 12, 2017 at 10:47 AM, John McKown <john.archie.mckown@gmail.com> wrote:
On Tue, Dec 12, 2017 at 9:43 AM, James Keener <jim@jimkeener.com> wrote:
Sorry for spamming the list. It appears that I'm an idiot. Sorry :(

​I guess we're even now. We both made a similar mistake.​

​But, despite my error, I still think the OP's need for an EBCDIC order is to compare output from parallel runs of an application from both an EBCDIC host and and ASCII host, to make sure they are "the same".

--
I have a theory that it's impossible to prove anything, but I can't prove it.

Maranatha! <><
John McKown

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Size of pg_multixact/members increases 11355
Next
From: George Neuner
Date:
Subject: Re: Is it possible to sort strings in EBCDIC order in PostgreSQL server?