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

From Joe Conway
Subject Re: pgcryto strangeness...
Date
Msg-id 3C376C21.8080407@home.com
Whole thread Raw
In response to pgcryto strangeness...  (Sean Chittenden <sean@chittenden.org>)
List pgsql-hackers
Sean Chittenden wrote:

> 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
> 


Not sure if you are in a position to do this, but why not make your 
password field bytea instead of varchar? This won't work if you need to 
support multibyte passwords, but I think it should be fine otherwise.


test=# create table users_shadow_2(password bytea);
CREATE
test=# insert into users_shadow_2 values('secret');
INSERT 1492553 1
test=# SELECT DIGEST(password, 'md5') FROM users_shadow_2;                       digest
------------------------------------------------------^\276"\224\354\320\340\360\216\253v\220\322\246\356i

Joe



pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: Some interesting results from tweaking spinlocks
Next
From: Tom Lane
Date:
Subject: Re: pgcryto strangeness...