pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedDB Encoding question
3+ messages / 3 participants
[nested] [flat]
* DB Encoding question
@ 2022-08-22 16:20 Sbob <sbob@quadratum-braccas.com>
2022-08-22 16:40 ` Re: DB Encoding question Bruce Momjian <bruce@momjian.us>
2022-08-22 16:41 ` Re: DB Encoding question Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 3+ messages in thread
From: Sbob @ 2022-08-22 16:20 UTC (permalink / raw)
To: Pgsql-admin <pgsql-admin@lists.postgresql.org>
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?
Thanks in advance
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: DB Encoding question
2022-08-22 16:20 DB Encoding question Sbob <sbob@quadratum-braccas.com>
@ 2022-08-22 16:40 ` Bruce Momjian <bruce@momjian.us>
1 sibling, 0 replies; 3+ messages in thread
From: Bruce Momjian @ 2022-08-22 16:40 UTC (permalink / raw)
To: Sbob <sbob@quadratum-braccas.com>; +Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
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@momjian.us> https://momjian.us
EDB https://enterprisedb.com
Indecision is a decision. Inaction is an action. Mark Batterson
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: DB Encoding question
2022-08-22 16:20 DB Encoding question Sbob <sbob@quadratum-braccas.com>
@ 2022-08-22 16:41 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 3+ messages in thread
From: Tom Lane @ 2022-08-22 16:41 UTC (permalink / raw)
To: Sbob <sbob@quadratum-braccas.com>; +Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Sbob <sbob@quadratum-braccas.com> writes:
> 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
You're going to need to run the data through an encoding conversion,
then.
> Will we be better off changing the PostgreSQL encoding to match the DB2
> database?
No, because Postgres doesn't support EBCDIC encoding.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2022-08-22 16:41 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-08-22 16:20 DB Encoding question Sbob <sbob@quadratum-braccas.com>
2022-08-22 16:40 ` Bruce Momjian <bruce@momjian.us>
2022-08-22 16:41 ` Tom Lane <tgl@sss.pgh.pa.us>
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