Re: pgcryto strangeness...

From: Bear Giles <bear(at)coyotesong(dot)com>
To: Sean Chittenden <sean(at)chittenden(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgcryto strangeness...
Date: 2002-01-05 15:46:38
Message-ID: 200201051546.IAA11245@eris.coyotesong.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

> host=# SELECT DIGEST('asdf', 'md5') FROM users_shadow;
> digest
> ------------------------------------------------
> \221.\310\003\262\316I\344\245A\006\215IZ\265p
> (1 row)

You must encode() the results.

(For the record, I consider that a serious design flaw.
It may not be possible to safely dump and restore tables
containing unencoded 8-bit data.)

> host=# SELECT DIGEST(password, 'md5') FROM users_shadow;
> ERROR: Function 'digest(varchar, unknown)' does not exist
> Unable to identify a function that satisfies the given argument types
> You may need to add explicit typecasts
> host=# SELECT DIGEST(CAST(password AS bytea), CAST('md5' AS TEXT)) FROM users_shadow;
> ERROR: Cannot cast type 'varchar' to 'bytea'

Try dropping the first cast.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-01-05 17:46:09 Re: Some interesting results from tweaking spinlocks
Previous Message mlw 2002-01-05 15:11:29 Re: Some interesting results from tweaking spinlocks

Browse pgsql-patches by date

  From Date Subject
Next Message Sean Chittenden 2002-01-05 19:11:10 Re: pgcryto strangeness...
Previous Message Sean Chittenden 2002-01-05 08:46:40 pgcryto strangeness...