Re: encode(bytea_value, 'escape') in PostgreSQL 9.0 - Mailing list pgsql-general

From Florian Weimer
Subject Re: encode(bytea_value, 'escape') in PostgreSQL 9.0
Date
Msg-id 82oc8zi9vy.fsf@mid.bfk.de
Whole thread Raw
In response to Re: encode(bytea_value, 'escape') in PostgreSQL 9.0  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: encode(bytea_value, 'escape') in PostgreSQL 9.0
List pgsql-general
* Tom Lane:

> Florian Weimer <fweimer@bfk.de> writes:
>> The old 'escape' encoding used by PostgreSQL 8.4 and prior was pretty
>> helpful for getting human-readable strings in psql.  It seems this
>> functionality was removed in PostgreSQL 9.0.  Was this an accident or
>> a deliberate decision?  Could we get it back, please?
>
> I think you're looking for "set bytea_output = escape".

To me, this seems problematic as a general recommendation because
programs won't use this, and it's confusing to have different output
in psql than what your program sees.  That's why I don't want to put
it into .psqlrc.  The separate command will raise a few eyebrows here
and there. 8-/

Put differently, I think it's rather odd that in 9.0, both
encode(bytea_value, 'escape') and encode(bytea_value, 'hex') output
hexadecimal values.  There's also an explicit way to request such
output, so I don't think that encode() should obey the bytea_output
setting.  In 8.4's psql, a BYTEA column and its escape-encoded TEXT
were displayed differently, so there is precedent.

--
Florian Weimer                <fweimer@bfk.de>
BFK edv-consulting GmbH       http://www.bfk.de/
Kriegsstraße 100              tel: +49-721-96201-1
D-76133 Karlsruhe             fax: +49-721-96201-99

pgsql-general by date:

Previous
From: "Marc Mamin"
Date:
Subject: Re: RESET ROLE and search_path, Connection pool
Next
From: Devrim GÜNDÜZ
Date:
Subject: Re: PostgreSQL 9.0 RPMs for RHEL 6 and Fedora 14 released