Re: DB Encoding question

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Sbob <sbob(at)quadratum-braccas(dot)com>
Cc: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: DB Encoding question
Date: 2022-08-22 16:40:50
Message-ID: YwOxkk0X0Ikp0baG@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, Aug 22, 2022 at 10:20:41AM -0600, Sbob wrote:
> All;
>
>
> We are converting from DB2 on the mainframe to PostgreSQL 14 in the cloud.
> We have been using IIDR to dump DB2 tables to CSV files and then using
> pg_loader / COPY to import the files. However the DB2 Encoding is EBCDIC and
> the PostgreSQL db encoding is UTF8, this is causing some rows / columns to
> fail when we try to load the data into PostgreSQL
>
> Will we be better off changing the PostgreSQL encoding to match the DB2
> database? Will this cause other issues down the road? Is there a 'best
> practice' for this use case?

I would convert the dump file to be UTF8 using iconv and then load it.
I would also suggest setting the _client_ encoding to EBCDIC and have
the server encoding be UTF8, but we don't support EBCDIC as far as I can
tell.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

Indecision is a decision. Inaction is an action. Mark Batterson

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2022-08-22 16:41:59 Re: DB Encoding question
Previous Message Sbob 2022-08-22 16:20:41 DB Encoding question