Re: Cast text to bytea

Поиск
Список
Период
Сортировка
От Alvar Freude
Тема Re: Cast text to bytea
Дата
Msg-id 1268530000.1070444219@gnarzelwicht.delirium-arts.de
обсуждение исходный текст
Ответ на Cast text to bytea  (Alvar Freude <alvar@a-blast.org>)
Ответы Re: Cast text to bytea: the Solution
Список 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 по дате отправления:

Предыдущее
От: Alex Satrapa
Дата:
Сообщение: Re: DBD::Pg problem
Следующее
От: "Ausrack Webmaster"
Дата:
Сообщение: Re: DBD::Pg problem