Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOJpD-0007CK-AP for pgsql-general@arkaria.postgresql.org; Mon, 11 Dec 2017 08:52:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOJpC-0001X9-5R for pgsql-general@arkaria.postgresql.org; Mon, 11 Dec 2017 08:52:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eOJpB-0001Wy-U0 for pgsql-general@lists.postgresql.org; Mon, 11 Dec 2017 08:52:33 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eOJp4-0006vN-Fd for pgsql-general@postgresql.org; Mon, 11 Dec 2017 08:52:33 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 0439547E32; Mon, 11 Dec 2017 09:52:23 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id IJKSV0LPRR2K; Mon, 11 Dec 2017 09:52:23 +0100 (CET) Message-ID: <1512982341.2699.17.camel@cybertec.at> Subject: Re: Is it possible to sort strings in EBCDIC order in PostgreSQL server? From: Laurenz Albe To: "Tsunakawa, Takayuki" , "pgsql-general@postgresql.org" Date: Mon, 11 Dec 2017 09:52:21 +0100 In-Reply-To: <0A3221C70F24FB45833433255569204D1F84A7AD@G01JPEXMBYT05> References: <0A3221C70F24FB45833433255569204D1F84A7AD@G01JPEXMBYT05> Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tsunakawa, Takayuki wrote: > 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. That should not be too difficult. PostgreSQL is extensible! Just define operators that implement <, <=, =, >= and > for EBCDIC, create an operator class for these (for indexing) and use ORDER BY ... USING. Yours, Laurenz Albe