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

From Jasen Betts
Subject Re: encode(bytea_value, 'escape') in PostgreSQL 9.0
Date
Msg-id ie4rn3$scs$8@reversiblemaps.ath.cx
Whole thread Raw
In response to encode(bytea_value, 'escape') in PostgreSQL 9.0  (Florian Weimer <fweimer@bfk.de>)
List pgsql-general
On 2010-12-06, Florian Weimer <fweimer@bfk.de> wrote:
> * 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,

programs should be using libpq's unescape_bytea and thus be
immune to changes in the representation.

If you want predictable representation base64 (or hex) your data and
store it in a text column postgres will compress long values so not
hardly any space will be wasted.

> 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-/

ALTER DATABASE whatever SET bytea_output = escape;

or

ALTER USER whoever SET bytea_output = escape;




--
⚂⚃ 100% natural

pgsql-general by date:

Previous
From: Jasen Betts
Date:
Subject: Re: Do we want SYNONYMS?
Next
From: pasman pasmański
Date:
Subject: Fatal accident :)