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