Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 43D6B6345AF; Fri, 5 Jun 2009 00:40:48 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 62504-02; Fri, 5 Jun 2009 00:40:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.televork.ee (mail.televork.ee [81.21.241.190]) by mail.postgresql.org (Postfix) with ESMTP id 8105263413D; Fri, 5 Jun 2009 00:40:45 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mail.televork.ee (Postfix) with ESMTP id F09BB18E0FC; Fri, 5 Jun 2009 06:40:41 +0300 (EEST) X-Virus-Scanned: at mail.televork.ee Received: from mail.televork.ee ([81.21.241.190]) by localhost (mail.televork.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SRmB9OO0qWQM; Fri, 5 Jun 2009 06:40:32 +0300 (EEST) Received: from [127.0.0.1] (81-21-242-98.televork.ee [81.21.242.98]) by mail.televork.ee (Postfix) with ESMTP id D45C418E1AD; Fri, 5 Jun 2009 06:40:31 +0300 (EEST) 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\": From: Hannu Krosing To: john.lister@kickstone.com Cc: Craig Ringer , pgsql-jdbc-owner@postgresql.org, Kris Jurka , user2037@ymail.com, pgsql-jdbc@postgresql.org 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> Content-Type: text/plain Date: Thu, 04 Jun 2009 15:21:04 +0300 Message-Id: <1244118064.5442.1.camel@huvostro> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.897 tagged_above=0 required=5 tests=AWL=-0.873, DATE_IN_PAST_12_24=1.77 X-Spam-Level: X-Archive-Number: 200906/31 X-Sequence-Number: 19695 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