Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-admin by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group