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\": - Mailing list pgsql-jdbc

From Hannu Krosing
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
Msg-id 1244118064.5442.1.camel@huvostro
Whole thread Raw
In response to 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\":  ("John Lister" <john.lister@kickstone.com>)
List pgsql-jdbc
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
sendingthe 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


pgsql-jdbc by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Deadlock detection
Next
From: Thomas Finneid
Date:
Subject: Re: COPY FROM STDIN support for JDK 1.6