Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oQATw-0001DU-RV for pgsql-admin@arkaria.postgresql.org; Mon, 22 Aug 2022 16:40:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oQATv-0005i9-Ls for pgsql-admin@arkaria.postgresql.org; Mon, 22 Aug 2022 16:40:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oQATv-0005hr-BY for pgsql-admin@lists.postgresql.org; Mon, 22 Aug 2022 16:40:55 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oQATs-0004Q4-8w for pgsql-admin@lists.postgresql.org; Mon, 22 Aug 2022 16:40:54 +0000 Received: from bruce by momjian.us with local (Exim 4.94.2) (envelope-from ) id 1oQATq-002UVO-B3; Mon, 22 Aug 2022 12:40:50 -0400 Date: Mon, 22 Aug 2022 12:40:50 -0400 From: Bruce Momjian To: Sbob Cc: Pgsql-admin Subject: Re: DB Encoding question Message-ID: References: <3529b018-3fd6-0d60-02b1-06ee5db9ba82@quadratum-braccas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3529b018-3fd6-0d60-02b1-06ee5db9ba82@quadratum-braccas.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 https://momjian.us EDB https://enterprisedb.com Indecision is a decision. Inaction is an action. Mark Batterson