Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jHrC2-0003w1-1s for pgsql-general@arkaria.postgresql.org; Fri, 27 Mar 2020 15:46:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jHrC0-0008Fs-3F for pgsql-general@arkaria.postgresql.org; Fri, 27 Mar 2020 15:46:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jHrBz-0008Fl-MB for pgsql-general@lists.postgresql.org; Fri, 27 Mar 2020 15:46:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jHrBs-00077b-GZ for pgsql-general@lists.postgresql.org; Fri, 27 Mar 2020 15:46:42 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 02RFkY62008923; Fri, 27 Mar 2020 11:46:35 -0400 From: Tom Lane To: Matthias Apitz cc: pgsql-general@lists.postgresql.org Subject: Re: \COPY to accept non UTF-8 chars in CHAR columns In-reply-to: <20200327153623.GA32266@sh4-5.1blu.de> References: <20200327153623.GA32266@sh4-5.1blu.de> Comments: In-reply-to Matthias Apitz message dated "Fri, 27 Mar 2020 16:36:23 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <8921.1585323994.1@sss.pgh.pa.us> Date: Fri, 27 Mar 2020 11:46:34 -0400 Message-ID: <8922.1585323994@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Matthias Apitz writes: > In short, it there a way to let \COPY accept such broken ISO bytes, just > complaining about, but not stopping the insert of the row? No. We don't particularly believe in the utility of invalid data. If you don't actually care about what encoding your data is in, you could use SQL_ASCII as the database "encoding" and thereby disable all UTF8-specific behavior. Otherwise, maybe this conversion is a good time to clean up the mess? regards, tom lane