Re: Cast text to bytea - Mailing list pgsql-general

From Alvar Freude
Subject Re: Cast text to bytea
Date
Msg-id 1268530000.1070444219@gnarzelwicht.delirium-arts.de
Whole thread Raw
In response to Cast text to bytea  (Alvar Freude <alvar@a-blast.org>)
Responses Re: Cast text to bytea: the Solution
List pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

- -- Alvar Freude <alvar@a-blast.org> wrote:

> But it seems that Postgres can't cast text to bytea:
>
>  odem=> UPDATE forum_gtree SET gid2=gid::bytea;
>  ERROR:  Cannot cast type text to bytea

I tryed it with DECODE:

  odem=> UPDATE forum_gtree SET gid2=(DECODE(gid::text, 'escape'));
  ERROR:  decode: Bad input string for type bytea

hmmm ...


The text columns contains values from \x01 to \xff -- everything exept the
null byte.


So, hmmm, it seems I'm faster writing a small piece of Perl to convert this
then searching a solution ... ;)


Ciao
  Alvar

- --
** Alvar C.H. Freude -- http://alvar.a-blast.org/
**   Berufsverbot? http://odem.org/aktuelles/staatsanwalt.de.html
**   ODEM.org-Tour: http://tour.odem.org/
**   Informationsgesellschaft: http://www.wsis-koordinierungskreis.de/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/za68OndlH63J86wRAmE/AKCCaQU/YDFNv6fnri6D7I6Q74ts7QCfcqE1
S+I44j/Lx3mots/pt5EWBJE=
=LVOG
-----END PGP SIGNATURE-----


pgsql-general by date:

Previous
From: Alex Satrapa
Date:
Subject: Re: DBD::Pg problem
Next
From: "Ausrack Webmaster"
Date:
Subject: Re: DBD::Pg problem