How to cast VARCHAR to BYTEA and vice-versa?

From: "Moran(dot)Michael" <Michael(dot)Moran(at)IGT(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: How to cast VARCHAR to BYTEA and vice-versa?
Date: 2005-03-08 15:31:02
Message-ID: B27C8914860EE24E865D189A3735EA5310091D@lasexch03.is.ad.igt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello all,

I have a table with a VARCHAR column that I need to convert to a BYTEA.

How do I cast VARCHAR to BYTEA?

The following doesn't seem to work as it yields the 'cannot cast varchar to
bytea' error message:

varchar_data::bytea

On the same topic, how do I do the reverse, that is, how to I cast from
BYTEA back to VARCHAR?

Thanks,
-Michael Moran

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2005-03-08 15:37:51 Re: Query issue/8.0.1/Serendipity
Previous Message Larry Rosenman 2005-03-08 12:36:38 Re: Query issue/8.0.1/Serendipity