Re: encode(bytea_value, 'escape') in PostgreSQL 9.0

From: Florian Weimer <fweimer(at)bfk(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: encode(bytea_value, 'escape') in PostgreSQL 9.0
Date: 2010-12-06 08:27:29
Message-ID: 82oc8zi9vy.fsf@mid.bfk.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

* Tom Lane:

> Florian Weimer <fweimer(at)bfk(dot)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(at)bfk(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Devrim GÜNDÜZ 2010-12-06 14:29:54 Re: PostgreSQL 9.0 RPMs for RHEL 6 and Fedora 14 released
Previous Message Marc Mamin 2010-12-06 07:14:49 Re: RESET ROLE and search_path, Connection pool