Search Postgresql Archives

Re: cast bytea to text

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

 



> How can i cast bytea to text?
> I´ve read about the DECODE function, but my 8.1 backend 
> doesn´t recognize it.
> I´m trying to create an implicit cast using the function:
> 
> create or replace function bytea2text(bytea) returns text as 
> $$
> select DECODE($1, 'escape');
> $$
> language sql strict;
> 
> Answer:
> ERROR: function decode(bytea, "unknown") does not exist

Try ENCODE instead of DECODE ...

Yours,
Laurenz Albe


[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