Thread: PASSWORD() function for postgresql?

PASSWORD() function for postgresql?

From
geniusj@bluenugget.net
Date:
I am looking for a postgresql PASSWORD() function that
produces hashes compatible with MySQL's implementation.

I am converting from MySQL and I know of no other way to
use the passwords I have in the old database other than
having a compatible PASSWORD() function.

I have searched around for one quite a bit but could not find
one.  Does anyone know if someone has written something
to do this already?  If so, where I can get it from?

Thanks in advance,
Jason DiCioccio



Re: PASSWORD() function for postgresql?

From
"Thalis A. Kalfigopoulos"
Date:
I don't recal finding anything similar to MySQL's password() (quote handy if you ask me). But if you look under the
contribdirectory of your source tree you'll find a pgcrypto directory. Compile and install the functions defined in
there.
The substitute which worked in my case was: encode(digest('text_i_want_to_encode','sha1'),'hex'); It is not the same
butit is a 1-way hashing of a string (IIRC password() is 1-way) 

cheers,
thalis


On Sun, 15 Jul 2001 geniusj@bluenugget.net wrote:

> I am looking for a postgresql PASSWORD() function that
> produces hashes compatible with MySQL's implementation.
>
> I am converting from MySQL and I know of no other way to
> use the passwords I have in the old database other than
> having a compatible PASSWORD() function.
>
> I have searched around for one quite a bit but could not find
> one.  Does anyone know if someone has written something
> to do this already?  If so, where I can get it from?
>
> Thanks in advance,
> Jason DiCioccio
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>