From: Tom Lane <tgl@sss.pgh.pa.us>
To: rpegues@tripwire.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14038: substring cuts unicode char in half, allowing to save broken utf8 into table
Date: Mon, 21 Mar 2016 12:46:30 -0400
Message-ID: <22852.1458578790@sss.pgh.pa.us> (raw)
In-Reply-To: <20160321143927.2903.55302@wrigleys.postgresql.org>
References: <20160321143927.2903.55302@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
rpegues@tripwire.com writes:
> We have a table with an update trigger where if you modify a certain column,
> we change the name of the row by calling a function.
> In the function, substring() the name and then add a random string to that.
> However, the substring appears to cut a unicode character in half, and the
> update trigger then updates the name with the broken string.
That should not happen if Postgres knows it's dealing with unicode data.
What have you got the database's encoding set to?
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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: tgl@sss.pgh.pa.us, rpegues@tripwire.com
Subject: Re: BUG #14038: substring cuts unicode char in half, allowing to save broken utf8 into table
In-Reply-To: <22852.1458578790@sss.pgh.pa.us>
References: <20160321143927.2903.55302@wrigleys.postgresql.org> <22852.1458578790@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