pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Reece Pegues <RPegues@tripwire.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: BUG #14038: substring cuts unicode char in half, allowing to save broken utf8 into table
Date: Tue, 22 Mar 2016 00:47:23 +0000
Message-ID: <D3160E38.2CF84%rpegues@tripwire.com> (raw)
In-Reply-To: <1163.1458594276@sss.pgh.pa.us>
References: <20160321143927.2903.55302@wrigleys.postgresql.org>
	<22852.1458578790@sss.pgh.pa.us>
	<D315A115.2CF4F%rpegues@tripwire.com>
	<1163.1458594276@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

I see, thanks Tom! 

On 3/21/16, 5:04 PM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:

>Reece Pegues <RPegues@tripwire.com> writes:
>> Looks like the database is created with ENCODING = 'SQL_ASCII'
>
>Basically what that does is defeats all encoding checks inside the
>backend; it'll store whatever bytes you give it.  So yeah, substring()
>is expected to deal in bytes not characters in this encoding.
>
>> So I assume it was thus saving the data that way, and then if the client
>> encoding is utf8 it tried to encode to that and failed?
>
>If client declares its encoding, the backend will verify correct encoding
>before transmitting data; but if the database encoding is SQL_ASCII then
>no actual conversion happens, only a validity check at transmit/receive.
>
>			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



view thread (5+ messages)

Message-ID: <D3160E38.2CF84%rpegues@tripwire.com>
Permalink:  ../D3160E38.2CF84%25rpegues@tripwire.com/
Also on:    postgresql.org/message-id/D3160E38.2CF84%rpegues@tripwire.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: RPegues@tripwire.com, tgl@sss.pgh.pa.us
  Subject: Re: BUG #14038: substring cuts unicode char in half, allowing to save broken utf8 into table
  In-Reply-To: <D3160E38.2CF84%rpegues@tripwire.com>
  References: <20160321143927.2903.55302@wrigleys.postgresql.org> <22852.1458578790@sss.pgh.pa.us> <D315A115.2CF4F%rpegues@tripwire.com> <1163.1458594276@sss.pgh.pa.us> <D3160E38.2CF84%rpegues@tripwire.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