pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <craig@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: PostgreSQL fails to convert decomposed utf-8 to other encodings
Date: Wed, 06 Aug 2014 11:54:32 +0800
Message-ID: <53E1A6F8.1000104@2ndquadrant.com> (raw)
In-Reply-To: <1523.1407287675@sss.pgh.pa.us>
References: <53E179E1.3060404@2ndquadrant.com>
	<1523.1407287675@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 08/06/2014 09:14 AM, Tom Lane wrote:
> We don't actually support "decomposed" utf8; if there is any bug here,
> it's that the input you show isn't rejected.  But I think there was
> some intentional choice to not check \u escapes fully.

Combining characters (i.e. decomposed utf-8 form, for chars where there
is a combined equivalent) are part of utf-8. They're not an optional add-on.

So if Pg doesn't support them, it doesn't fully support utf-8. Which is
fine as far as it goes, but must be documented as a limitation at
minimum. (I'll deal with that).

It also means that you get fun anomalies like:

regress=> SELECT 'á' = 'á';
 ?column?
----------
 f
(1 row)

which is IMO insane.

Not only that, but we can't reject decomposed forms, because they will
already exist in live installs. That'd break dump and reload of such
installs and cause exciting problems with pg_upgrade.

The "we'll just reject part of utf-8" opportunity has flown. It needs to
be documented as a bug in existing versions, and I guess given that I'm
the one complaining I get to see if I can find a sane fix for 9.5...

-- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (5+ messages)  latest in thread

Message-ID: <53E1A6F8.1000104@2ndquadrant.com>
Permalink:  ../53E1A6F8.1000104@2ndquadrant.com/
Also on:    postgresql.org/message-id/53E1A6F8.1000104@2ndquadrant.com

 · 

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-bugs@postgresql.org
  Cc: craig@2ndquadrant.com, tgl@sss.pgh.pa.us
  Subject: Re: PostgreSQL fails to convert decomposed utf-8 to other encodings
  In-Reply-To: <53E1A6F8.1000104@2ndquadrant.com>
  References: <53E179E1.3060404@2ndquadrant.com> <1523.1407287675@sss.pgh.pa.us> <53E1A6F8.1000104@2ndquadrant.com>

* 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