Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2010-12-06, Florian Weimer <fweimer@xxxxxx> wrote:
> * Tom Lane:
>
>> Florian Weimer <fweimer@xxxxxx> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux