Re: Move passwords between databases

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Raj Mathur <raju(at)linux-delhi(dot)org>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Move passwords between databases
Date: 2003-06-16 19:27:33
Message-ID: 6159.1055791653@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Raj Mathur <raju(at)linux-delhi(dot)org> writes:
> mdu=# alter user raju with encrypted password 'raju';
> ALTER USER
> mdu=# select passwd from pg_shadow where usename='raju';
> passwd
> -------------------------------------
> md5ef70c430d5ed1ed52bd2ae960bb8ebe4
> (1 row)

> mdu=# create user xxx with password 'md5ef70c430d5ed1ed52bd2ae960bb8ebe4';
> CREATE USER

That's not going to work, because the user name is included into the
password encryption algorithm, so two different usernames with the same
cleartext password are going to have two different encrypted passwords.
(This is a feature, not a bug.)

You can transfer the same usernames with the same passwords from one
system to another using the method shown above. You cannot assign one
user's password to another username this way.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Alex.H.Pollock 2003-06-16 23:50:00 transactions included in hot backup
Previous Message Tom Lane 2003-06-16 19:22:11 Re: how do I get rid of huge sorttemp files?