Re: invalidly encoded strings - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: invalidly encoded strings
Date
Msg-id 20070910162501.GG16512@svana.org
Whole thread Raw
In response to Re: invalidly encoded strings  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Sep 10, 2007 at 11:48:29AM -0400, Tom Lane wrote:
> BTW, I'm sure this was discussed but I forgot the conclusion: should
> chr(0) throw an error?  If we're trying to get rid of embedded-null
> problems, seems it must.

It is pointed out on wikipedia that Java sometimes uses to byte pair C0
80 to represent the NUL character to allow it to be embedded in C
strings without tripping anything up. It is however technically an
illegal representation (violates the minimal representation rule) and
thus rejected by postgres. I'm not suggesting we copy this, but it does
show there are other ways to deal with this.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: integrated tsearch doesn't work with non utf8 database
Next
From: "Heikki Linnakangas"
Date:
Subject: Ts_rank internals