Bruce Momjian wrote: > Tom Lane wrote: > > Bruce Momjian <[EMAIL PROTECTED]> writes: > > > The attached patch clears the password field on rename: > > > > I think you should clear the password field *only* if it's > > MD5-encrypted. > > Patch attached and applied.
Oh, I forgot to display the new behavior: test=> CREATE USER test; CREATE USER test=> ALTER USER test RENAME TO test2; ALTER USER test=> ALTER USER test2 UNENCRYPTED PASSWORD 'x'; ALTER USER test=> ALTER USER test2 RENAME TO test4; ALTER USER test=> ALTER USER test4 PASSWORD 'x'; ALTER USER test=> ALTER USER test4 RENAME TO test8; NOTICE: MD5 password cleared because of user rename ALTER USER test=> SELECT * FROM pg_shadow WHERE usename = 'test8'; usename | usesysid | usecreatedb | usesuper | usecatupd | passwd | valuntil | useconfig ---------+----------+-------------+----------+-----------+--------+----------+----------- test8 | 100 | f | f | f | | | (1 row) -- Bruce Momjian | http://candle.pha.pa.us [EMAIL PROTECTED] | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])