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