pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dylan Milks <DMilks@greenridge.ca>
To: PostgreSQL (E-mail) <pgsql-admin@postgresql.org>
Subject: Casting varchar to bytea
Date: Fri, 12 Sep 2003 13:39:27 -0500
Message-ID: <84D4D76946AC2F43AA9BDCD860DC667518C18D@voyager.greenridge-int.ca> (raw)

Hi. Could someone please tell me how to convert a "varchar" to a "bytea" datatype. 

I have a column which contains a number stored as a varchar. I have another column of type bytea. I'm trying to insert the value of the varchar column in the bytea column, but the conversion won't work.

Something like the following:

update webuser set ccnum = ccnumstring::bytea where userid=userid;

Any ideas how to do this?

Also, I have the PGCRYPTO module and I can't get the AES algorithm to decrypt properly. It will encrypt, but not decrypt. However, I can get the BLOWFISH algorithm to work in both directions. Can someone please give me an example of decrypting using the AES algorithm?

Thanks in advance.

Dylan



view thread (3+ messages)  latest in thread

Message-ID: <84D4D76946AC2F43AA9BDCD860DC667518C18D@voyager.greenridge-int.ca>
Permalink:  ../84D4D76946AC2F43AA9BDCD860DC667518C18D@voyager.greenridge-int.ca/
Also on:    postgresql.org/message-id/84D4D76946AC2F43AA9BDCD860DC667518C18D@voyager.greenridge-int.ca

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: DMilks@greenridge.ca
  Subject: Re: Casting varchar to bytea
  In-Reply-To: <84D4D76946AC2F43AA9BDCD860DC667518C18D@voyager.greenridge-int.ca>
  References: <84D4D76946AC2F43AA9BDCD860DC667518C18D@voyager.greenridge-int.ca>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox