From: Tom Lane <tgl@sss.pgh.pa.us>
To: Christian Ramseyer <rc@networkz.ch>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Encoding conversion: Use replacement character instead of failing query with "ERROR: character with byte sequence 0xd0 0xad in encoding "UTF8" has no equivalent in encoding LATIN1" ?
Date: Tue, 05 May 2020 20:00:47 -0400
Message-ID: <1791.1588723247@sss.pgh.pa.us> (raw)
In-Reply-To: <3c30a47a-09c8-8b36-3ebb-6336c0f089d6@networkz.ch>
References: <3c30a47a-09c8-8b36-3ebb-6336c0f089d6@networkz.ch>
Christian Ramseyer <rc@networkz.ch> writes:
> Can I somehow influence the client:UTF8->server:LATIN1 character set
> conversion so that instead of failing, it inserts an invalid codepoint
> character, the utf8 hex bytes as string, drops the character or
> something like that?
There's nothing built-in for that, but it seems like it wouldn't be
hard to modify the code if you wanted a quick hack to do this.
In general, the system nominally supports multiple conversion functions
per encoding pair, so you could imagine having an alternate conversion
that doesn't throw errors. Problem is that it's quite difficult to get
the system to actually *use* a non-default conversion for anything really
significant, like say client I/O. I don't know that anyone's thought
hard about how to improve that.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, rc@networkz.ch
Subject: Re: Encoding conversion: Use replacement character instead of failing query with "ERROR: character with byte sequence 0xd0 0xad in encoding "UTF8" has no equivalent in encoding LATIN1" ?
In-Reply-To: <1791.1588723247@sss.pgh.pa.us>
References: <3c30a47a-09c8-8b36-3ebb-6336c0f089d6@networkz.ch> <1791.1588723247@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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