> You can't directly cast varchar to bytea, but you can use decode(in 7.2):
>
> test=# select version();
> version
> -------------------------------------------------------------
> PostgreSQL 7.2b3 on i686-pc-linux-gnu, compiled by GCC 2.96
> (1 row)
>
> test=# create table users_shadow(password varchar(20));
> CREATE
> test=# insert into users_shadow values('secret');
> INSERT 1492547 1
> test=# SELECT DIGEST(decode(password,'escape'), 'md5') FROM users_shadow;
> digest
> ------------------------------------------------------
> ^\276"\224\354\320\340\360\216\253v\220\322\246\356i
> (1 row)
>
>
> HTH,
Yeah, it does... but it also tells me I'm SOL for 7.1.3 even though
pgcrypto comes with a DECODE() function (only supports 'hex' and
'base64'). Any other ideas? <:~) -sc
--
Sean Chittenden