Re: EBCDIC conversion

From: David W Noon <david(dot)w(dot)noon(at)googlemail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: EBCDIC conversion
Date: 2014-03-28 00:31:18
Message-ID: 5334C2D6.5070307@googlemail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 27/03/14 19:08, Mike Blackwell wrote:
> We have a need to check certain text fields to be sure they'll
> convert properly to EBCDIC. A check constraint with a convert()
> was the initial thought, but there doesn't seem to be a default
> conversion from UTF8 to EBCDIC. Does anyone have an
> implementation they'd care to share, or suggestions on the best way
> to implement the conversion function? Our PostgreSQL servers
> currently only have the default languages installed.

I think the real issue is that you need icu or libiconv installed.
You will also need to know which EBCDIC code page you want: U.S.
EBCDIC is cp37, IIRC.

I suspect you will need to write a C or Python function that performs
a test conversion, using icu or libiconv, and return a Boolean result.
It should not be too difficult if you can write C or Python.
- --
Regards,

Dave [RLU #314465]
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
david(dot)w(dot)noon(at)googlemail(dot)com (David W Noon)
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlM0wtYACgkQogYgcI4W/5TYsgCgwGf/HBL7XHGc5HrzYiLSkXcZ
nv8An1Ysq9DEJw2vn/mRpY2UWv5sFHna
=grZk
-----END PGP SIGNATURE-----

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Ainsworth 2014-03-28 01:36:25 The result of the last function call overwrites the result of previous function calls
Previous Message Steven Schlansker 2014-03-27 19:47:25 Re: Trimming transaction logs after extended WAL archive failures