Skip site navigation (1) Skip section navigation (2)

pgsql: Fix encode(...bytea..., 'escape') so that it converts all

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix encode(...bytea..., 'escape') so that it converts all
Date: 2008-02-26 02:54:08
Message-ID: 20080226025408.1EA28754108@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
Fix encode(...bytea..., 'escape') so that it converts all high-bit-set byte
values into \nnn octal escape sequences.  When the database encoding is
multibyte this is *necessary* to avoid generating invalidly encoded text.
Even in a single-byte encoding, the old behavior seems very hazardous ---
consider for example what happens if the text is transferred to another
database with a different encoding.  Decoding would then yield some other
bytea value than what was encoded, which is surely undesirable.  Per gripe
from Hernan Gonzalez.

Backpatch to 8.3, but not further.  This is a bit of a judgment call, but I
make it on these grounds: pre-8.3 we don't really have much encoding safety
anyway because of the convert() function family, and we would also have much
higher risk of breaking existing apps that may not be expecting this behavior.
8.3 is still new enough that we can probably get away with making this change
in the function's behavior.

Modified Files:
--------------
    pgsql/src/backend/utils/adt:
        encode.c (r1.20 -> r1.21)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/encode.c?r1=1.20&r2=1.21)

pgsql-committers by date

Next:From: Tom LaneDate: 2008-02-26 02:54:14
Subject: pgsql: Fix encode(...bytea..., 'escape') so that it converts all
Previous:From: D'Arcy J.M. CainDate: 2008-02-26 02:42:44
Subject: Re: [COMMITTERS] pgsql: Link postgres from all object files at once, to avoid the

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group