Re: \COPY to accept non UTF-8 chars in CHAR columns

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Matthias Apitz <guru(at)unixarea(dot)de>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: \COPY to accept non UTF-8 chars in CHAR columns
Date: 2020-03-27 15:46:34
Message-ID: 8922.1585323994@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Matthias Apitz <guru(at)unixarea(dot)de> 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Julien Rouhaud 2020-03-27 19:23:03 Re: PG12 autovac issues
Previous Message Matthias Apitz 2020-03-27 15:36:23 \COPY to accept non UTF-8 chars in CHAR columns