Re: how to read bytea field - Mailing list pgsql-general

From marcelo Cortez
Subject Re: how to read bytea field
Date
Msg-id 182201.38393.qm@web32103.mail.mud.yahoo.com
Whole thread Raw
In response to Re: how to read bytea field  (Richard Huxton <dev@archonet.com>)
Responses Re: how to read bytea field
List pgsql-general
Richard


 Hoooo i'm understood now!,
 sorry for the noise.
 thanks very, very much
 best regards
 mdc


--- Richard Huxton <dev@archonet.com> escribió:

> marcelo Cortez wrote:
> > ok my mistake ,
> >
> >  insert into pblfield( id_ , value_field )
> >    values(1 ,encode(E'\\000\\001', 'escape')
> ::bytea
> > ) ;
>
> No. Use "decode" to convert text to bytea, and
> "encode" to convert bytea
> to text.
>
> => CREATE TABLE tb (b bytea);
> CREATE TABLE
> richardh=> INSERT INTO tb VALUES (
> decode(E'\\000\\001\\002','escape') );
> INSERT 0 1
> richardh=> SELECT encode(b,'escape') FROM tb;
>      encode
> --------------
>   \000\x01\x02
> (1 row)
>
> richardh=> SELECT encode(b,'hex') FROM tb;
>   encode
> --------
>   000102
> (1 row)
>
> --
>    Richard Huxton
>    Archonet Ltd
>







__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas


pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: how to read bytea field
Next
From: Richard Huxton
Date:
Subject: Re: how to read bytea field