-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
- -- Alvar Freude <alvar@a-blast.org> wrote:
>
> odem=> UPDATE forum_gtree SET gid2=(DECODE(gid::text, 'escape'));
> ERROR: decode: Bad input string for type bytea
the solution is: backslashes in the text column are interpreted as escapes.
So: they must be marked escaped first. Replacing "\" with "\\" does this:
UPDATE table SET bytea_col =
(decode(replace(text_col, '\\', '\\\\'), 'escape'));
This seems to work and looks like there are the correct values in the new
column ...
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/zePPOndlH63J86wRAmEaAJ9LAWvLFwekca58BTWYYBuPgWrawACeJRjl
POrmVVWkT0+XmF7clqBtKlA=
=wH3M
-----END PGP SIGNATURE-----