Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id B44891337B4B for ; Wed, 13 Oct 2010 04:46:10 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 77081-03 for ; Wed, 13 Oct 2010 07:46:04 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail1.hosting.digiweb.ie (mail1.hosting.digiweb.ie [89.234.64.49]) by mail.postgresql.org (Postfix) with SMTP id BA4781337B55 for ; Wed, 13 Oct 2010 04:46:02 -0300 (ADT) Received: (qmail 16302 invoked by uid 399); 13 Oct 2010 07:44:20 -0000 Received: from unknown (HELO ?127.0.0.1?) (ray@teladesign.ie@86.43.79.16) by mail1.hosting.digiweb.ie with SMTP; 13 Oct 2010 07:44:20 -0000 X-Originating-IP: 86.43.79.16 Message-ID: <4CB563B6.8020803@iol.ie> Date: Wed, 13 Oct 2010 08:45:58 +0100 From: Raymond O'Donnell Reply-To: rod@iol.ie User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.4) Gecko/20100608 Lightning/1.0b2 Thunderbird/3.1 MIME-Version: 1.0 To: ljb CC: pgsql-general@postgresql.org Subject: Re: Gripe: bytea_output default => data corruption References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 101012-1, 12/10/2010), Outbound message X-Antivirus-Status: Clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.001 tagged_above=-5 required=5 tests=BAYES_20=-0.001 X-Spam-Level: X-Archive-Number: 201010/446 X-Sequence-Number: 168358 On 13/10/2010 01:37, ljb wrote: > Defaulting bytea output from the backend to use hex mode encoding, which is > incompatible with pre-9.0 interfaces, wasn't a friendly thing to do. The > default should have been escape mode. Or else you needed a big warning in > HISTORY that we must either change bytea_output, or upgrade all clients > before servers. Because using a 9.0 server with a 8.x libpq-based client > results in undetected data corruption when selecting BYTEA objects. > > By default, the 9.0 server encodes a bytea using hex mode, but an 8.x > libpq-based client will decode that using escape mode, with no error detected > on either end. For example, start with "A", encode to "\x40" decode to "x40". > > There are good reasons to break backward compatibility, like security or > standards compliance, but not performance. Please think twice next time you > consider breaking stuff just because you think the new way should be faster. In fairness, it *is* flagged in the release note - it's the first item under "data types" in the list of incompatibilities. Ray. -- Raymond O'Donnell :: Galway :: Ireland rod@iol.ie