Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id D46FD632C5B; Thu, 4 Jun 2009 10:26:36 -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 06634-08; Thu, 4 Jun 2009 10:26:24 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by mail.postgresql.org (Postfix) with ESMTP id AD830632300; Thu, 4 Jun 2009 10:26:29 -0300 (ADT) Received: from 219-89-243-186.adsl.xtra.co.nz ([219.89.243.186] helo=[192.168.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1MCCuP-000052-I5; Fri, 05 Jun 2009 01:23:05 +1200 Message-ID: <4A27CAB0.4040605@opencloud.com> Date: Fri, 05 Jun 2009 01:22:56 +1200 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: john.lister@kickstone.com CC: Craig Ringer , pgsql-jdbc-owner@postgresql.org, Kris Jurka , user2037@ymail.com, 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\": References: <1176993971-1244116729-cardhu_decombobulator_blackberry.rim.net-143516403-@bxe1101.bisx.produk.on.blackberry> In-Reply-To: <1176993971-1244116729-cardhu_decombobulator_blackberry.rim.net-143516403-@bxe1101.bisx.produk.on.blackberry> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200906/28 X-Sequence-Number: 19692 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. It's not that we can't transfer strings with embedded zero bytes to the server (we can), it's that the server does not handle the resulting string. From memory it just truncates the string at that point. So we disallow it in the driver rather than causing strange effects on the server side. So adding support for these strings to the binary patch would actually be a regression. -O