pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: raf <raf@raf.org>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Can I get some PostgreSQL developer feedback on these five general issues I have with PostgreSQL and its ecosystem?
Date: Mon, 14 Sep 2020 20:26:02 -0400
Message-ID: <1228142.1600129562@sss.pgh.pa.us> (raw)
In-Reply-To: <20200915000521.56vucbshwgs24fkm@raf.org>
References: <MHDH6oj--3-2@tutanota.com>
	<1176808.1600119597@sss.pgh.pa.us>
	<20200915000521.56vucbshwgs24fkm@raf.org>

raf <raf@raf.org> writes:
> On Mon, Sep 14, 2020 at 05:39:57PM -0400, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> On the other hand, the very same thing could be said of database names
>> and role names, yet we have never worried much about whether those were
>> encoding-safe when viewed from databases with different encodings, nor
>> have there been many complaints about the theoretical unsafety.  So maybe
>> this is just overly anal-retentive and we should drop the restriction,
>> or at least pass through data that doesn't appear to be invalidly
>> encoded.

> Perhaps recode database/role names from the source
> database's encoding into utf8, and then recode from utf8
> to the destination database's encoding?

A lot of people seem to believe that transcoding through utf8
is 100% safe.  They're wrong :-( --- the Japanese, at least,
have reason not to trust it, because of the existence of multiple
incompatible conversion standards.  And you're still left with the
question of what to do when the destination encoding hasn't
got the character.

Moreover, this is all moderately expensive unless the encodings in
question are already utf8 or latin1.  So if we go this way I'd
prefer to do it as I said above -- just drop or question-mark-ize
any characters that don't pass validation in the recipient DB.
That's fairly cheap and it will work perfectly in the typical case
where the whole cluster is on one encoding anyway.

			regards, tom lane





view thread (40+ messages)  latest in thread

Message-ID: <1228142.1600129562@sss.pgh.pa.us>
Permalink:  ../1228142.1600129562@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1228142.1600129562@sss.pgh.pa.us

 · 

reply

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, raf@raf.org
  Subject: Re: Can I get some PostgreSQL developer feedback on these five general issues I have with PostgreSQL and its ecosystem?
  In-Reply-To: <1228142.1600129562@sss.pgh.pa.us>
  References: <MHDH6oj--3-2@tutanota.com> <1176808.1600119597@sss.pgh.pa.us> <20200915000521.56vucbshwgs24fkm@raf.org> <1228142.1600129562@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