Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id B1C371337BBA for ; Fri, 1 Apr 2011 00:49:43 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 74107-05 for ; Fri, 1 Apr 2011 03:49:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from www.postnewspapers.com.au (www.postnewspapers.com.au [173.230.139.50]) by mail.postgresql.org (Postfix) with ESMTP id 5CD7B1337B82 for ; Fri, 1 Apr 2011 00:49:36 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by www.postnewspapers.com.au (Postfix) with ESMTP id AF8CFEB; Thu, 31 Mar 2011 23:49:35 -0400 (EDT) X-Virus-Scanned: amavisd-new at postnewspapers.com.au.com Received: from www.postnewspapers.com.au ([127.0.0.1]) by localhost (www.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id vEN80CNy1Nzr; Thu, 31 Mar 2011 23:49:34 -0400 (EDT) Received: from mail.postnewspapers.com.au (ppp171-128.static.internode.on.net [150.101.171.128]) by www.postnewspapers.com.au (Postfix) with ESMTP id A45C02D; Thu, 31 Mar 2011 23:49:34 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id A5139AEBFC; Fri, 1 Apr 2011 11:49:33 +0800 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (mail.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 1ZVXuVbXyDib; Fri, 1 Apr 2011 11:49:28 +0800 (WST) Received: from [10.1.1.3] (58-7-255-44.dyn.iinet.net.au [58.7.255.44]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTPSA id 1CA31AEBB7; Fri, 1 Apr 2011 11:49:28 +0800 (WST) Message-ID: <4D954B40.2050702@postnewspapers.com.au> Date: Fri, 01 Apr 2011 11:49:20 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: Vincent Chan CC: pgsql-bugs@postgresql.org Subject: Re: BUG #5939: About bytea References: <201103220634.p2M6YBtD083575@wwwmaster.postgresql.org> In-Reply-To: <201103220634.p2M6YBtD083575@wwwmaster.postgresql.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201104/1 X-Sequence-Number: 29920 On 22/03/2011 2:34 PM, Vincent Chan wrote: > > The following bug has been logged online: > > Bug reference: 5939 > Logged by: Vincent Chan > Email address: joy717.xmu@gmail.com > PostgreSQL version: 9.0 > Operating system: Win7 x64 > Description: About bytea > Details: > > when saving a bytes array, > for example a bytes array which length is 2, > but after saving, > it's length will be change to 3. > but in postgres 8.4, the array length is still 2. > Is this a bug? I'd say you're using a client driver version that doesn't understand hex-encoded escapes. Try setting bytea_output to 'escape' instead of 'hex'. It'd help if you provided even some minimal information like code samples, the language you're using, the version of the access driver (npgsql/pgodbc/libpq/psycopg/php-pgsql/etc) you're using, and other basic details. Please read the PostgreSQL 9.0 release notes: http://www.postgresql.org/docs/9.0/static/release-9-0.html and the documentation on bytea: http://www.postgresql.org/docs/9.0/static/datatype-binary.html -- Craig Ringer Tech-related writing at http://soapyfrogs.blogspot.com/