X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id BF3EAD1B437 for ; Tue, 2 Dec 2003 23:08:39 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 08394-10 for ; Tue, 2 Dec 2003 19:08:15 -0400 (AST) Received: from gnarzelwicht.delirium-arts.de (mail.delirium-arts.de [195.143.204.190]) by svr1.postgresql.org (Postfix) with ESMTP id 0E3F2D1B465 for ; Tue, 2 Dec 2003 19:07:53 -0400 (AST) Received: from gnarzelwicht.delirium-arts.de (gnarzelwicht.delirium-arts.de [195.143.204.190]) by gnarzelwicht.delirium-arts.de (Postfix) with ESMTP id 32B44EB14 for ; Wed, 3 Dec 2003 00:07:13 +0100 (CET) Date: Wed, 03 Dec 2003 00:07:12 +0100 From: Alvar Freude To: pgsql-admin@postgresql.org Subject: Cast text to bytea Message-ID: <868350000.1070406432@gnarzelwicht.delirium-arts.de> X-Mailer: Mulberry/3.1.0 (Linux/x86 Demo) X-message-flag: SICHERHEITSWARNUNG: Outlook ist ein Sicherheitsrisiko. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/15 X-Sequence-Number: 11523 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I want to change a column from text to bytea; since it seems that alter table can't change the column type, i have to add a temporary column and copy the data from the old one to the new, delete the old and rename the new. But it seems that Postgres can't cast text to bytea: > UPDATE forum_gtree SET gid2=gid::bytea; ERROR: Cannot cast type text to bytea How can I do this? encode/decode seems to handle only bytea data: http://www.postgresql.org/docs/current/interactive/functions-string.html Thanks && 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/zRsgOndlH63J86wRAn4aAJ0aY9Td3YcWwkIwdALInCXaruINcgCgoDtx FQmuBKPACLfE5YAmMTdCN4g= =OivL -----END PGP SIGNATURE-----