X-Original-To: pgsql-general-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id A02109DCA20 for ; Wed, 1 Feb 2006 12:23:05 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 77741-08 for ; Wed, 1 Feb 2006 12:23:01 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from dukecmmtar02.coxmail.com (dukecmmtar02.coxmail.com [68.99.120.49]) by postgresql.org (Postfix) with ESMTP id 0C6F59DCA3C for ; Wed, 1 Feb 2006 12:23:00 -0400 (AST) Received: from [192.168.1.200] (really [24.249.204.30]) by dukecmmtar02.coxmail.com (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20060201162313.DEVX26756.dukecmmtar02.coxmail.com@[192.168.1.200]>; Wed, 1 Feb 2006 11:23:13 -0500 Message-ID: <43E0E062.2040301@acm.org> Date: Wed, 01 Feb 2006 08:22:58 -0800 From: TJ O'Donnell Reply-To: tjo@acm.org User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: howardnews@selestial.com CC: pgsql-general@postgresql.org Subject: Re: Converting Text to Bytea References: <20060201141737.CDB1F512414@mx2.hub.org> In-Reply-To: <20060201141737.CDB1F512414@mx2.hub.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.16 required=5 tests=[AWL=0.160] X-Spam-Score: 0.16 X-Spam-Level: X-Archive-Number: 200602/35 X-Sequence-Number: 90700 decode(your_string,'escape') will convert text to bytea You can just use this as a sort of type cast, or: 1. Create a new bytea column in your table 2. Update the table, setting the newcolumn = decode(oldcolumn,'escape') 3. Drop the oldcolumn (or not) TJ Date: Wed, 01 Feb 2006 10:04:36 +0000 From: Howard Cole To: 'PgSql General' Subject: Converting Text to Bytea Message-ID: <43E087B4.4040601@selestial.com> Hi, Can anyone tell me how to convert a text column to a bytea column? Thanks. Howard Cole www.selestial.com