From: Hannu Krosing <hannu@2ndQuadrant.com>
To: john.lister@kickstone.com
Cc: Craig Ringer <craig@postnewspapers.com.au>
Cc: pgsql-jdbc-owner@postgresql.org
Cc: Kris Jurka <books@ejurka.com>
Cc: user2037@ymail.com
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Strings with null characters produce exceptions when selectedor inserted. Attempts to select messages with null bytes produces "ERROR:insufficient data left in message". And inserting produces "ERROR: invalidbyte sequence for encoding \"UTF8\":
Date: Thu, 04 Jun 2009 15:21:04 +0300
Message-ID: <1244118064.5442.1.camel@huvostro> (raw)
In-Reply-To: <1176993971-1244116729-cardhu_decombobulator_blackberry.rim.net-143516403-@bxe1101.bisx.produk.on.blackberry>
References: <1176993971-1244116729-cardhu_decombobulator_blackberry.rim.net-143516403-@bxe1101.bisx.produk.on.blackberry>
On Thu, 2009-06-04 at 11:58 +0000, John Lister wrote:
> Apologies for top post using a blackberry. The binary mode should be able to cope fine as it passes the length before sending the data. Should be straightforward to add strings to patch.
PostgreSQL itself does not consider byte sequences with embedded nulls
to be strings, as lot of its string-handling expects C strings
Use bytea type for "strings" with embedded nulls.
--
Hannu Krosing http://www.2ndQuadrant.com
PostgreSQL Scalability and Availability
Services, Consulting and Training
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-jdbc@postgresql.org
Cc: hannu@2ndQuadrant.com, john.lister@kickstone.com, craig@postnewspapers.com.au, pgsql-jdbc-owner@postgresql.org, books@ejurka.com, user2037@ymail.com
Subject: Re: Strings with null characters produce exceptions when selectedor inserted. Attempts to select messages with null bytes produces "ERROR:insufficient data left in message". And inserting produces "ERROR: invalidbyte sequence for encoding \"UTF8\":
In-Reply-To: <1244118064.5442.1.camel@huvostro>
References: <1176993971-1244116729-cardhu_decombobulator_blackberry.rim.net-143516403-@bxe1101.bisx.produk.on.blackberry> <1244118064.5442.1.camel@huvostro>
* 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