Thread: Fwd: How to convert a string to bytea?

Fwd: How to convert a string to bytea?

From
"Chris Hoover"
Date:


---------- Forwarded message ----------
From: Chris Hoover <revoohc@gmail.com>
Date: Aug 30, 2006 12:22 PM
Subject: How to convert a string to bytea?
To: "pgsql-admin@postgresql.org" <pgsql-admin@postgresql.org>

I am in need of some help.  I need to use the encode function against a text string in one of my pg/plsql functions.  However, the encode function expects a bytea field to be passed to it.  How do I convert my text string into a bytea?

Thanks,

Chris

Re: Fwd: How to convert a string to bytea?

From
Roman Neuhauser
Date:
# revoohc@gmail.com / 2006-08-30 12:22:47 -0400:
> ---------- Forwarded message ----------
> From: Chris Hoover <revoohc@gmail.com>
> Date: Aug 30, 2006 12:22 PM
> Subject: How to convert a string to bytea?
> To: "pgsql-admin@postgresql.org" <pgsql-admin@postgresql.org>
>
> I am in need of some help.  I need to use the encode function against a text
> string in one of my pg/plsql functions.  However, the encode function
> expects a bytea field to be passed to it.  How do I convert my text string
> into a bytea?

    See decode()/encode() in
    http://www.postgresql.org/docs/8.1/static/functions-binarystring.html

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991