Re: Converting Text to Bytea

From: TJ O'Donnell <tjo(at)acm(dot)org>
To: howardnews(at)selestial(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Converting Text to Bytea
Date: 2006-02-01 16:22:58
Message-ID: 43E0E062.2040301@acm.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 <howardnews(at)selestial(dot)com>
To: 'PgSql General' <pgsql-general(at)postgresql(dot)org>
Subject: Converting Text to Bytea
Message-ID: <43E087B4(dot)4040601(at)selestial(dot)com>

Hi,

Can anyone tell me how to convert a text column to a bytea column?

Thanks.

Howard Cole
www.selestial.com

Browse pgsql-general by date

  From Date Subject
Next Message MargaretGillon 2006-02-01 16:44:01 Concatenated VARCHAR becomes TEXT in view
Previous Message aktivists 2006-02-01 16:15:26 specifying unix domain socket name