Re: pgcryto strangeness... - Mailing list pgsql-hackers

From Sean Chittenden
Subject Re: pgcryto strangeness...
Date
Msg-id 20020105120939.Y36993@ninja1.internal
Whole thread Raw
In response to Re: pgcryto strangeness...  (Joe Conway <joseph.conway@home.com>)
Responses Re: pgcryto strangeness...
List pgsql-hackers
> 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


pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: pgcryto strangeness...
Next
From: Vince Vielhaber
Date:
Subject: testing 123