pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Raymond O'Donnell <rod@iol.ie>
To: ljb <ljb9832@pobox.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Gripe: bytea_output default => data corruption
Date: Wed, 13 Oct 2010 08:45:58 +0100
Message-ID: <4CB563B6.8020803@iol.ie> (raw)
In-Reply-To: <i92v0d$qfe$1@news.hub.org>
References: <i92v0d$qfe$1@news.hub.org>

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



view thread (21+ messages)  latest in thread

Message-ID: <4CB563B6.8020803@iol.ie>
Permalink:  ../4CB563B6.8020803@iol.ie/
Also on:    postgresql.org/message-id/4CB563B6.8020803@iol.ie

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: rod@iol.ie, ljb9832@pobox.com, pgsql-general@postgresql.org
  Subject: Re: Gripe: bytea_output default => data corruption
  In-Reply-To: <4CB563B6.8020803@iol.ie>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox