Обсуждение: Removing a user's password
Hi! Me again. <grin> I have learned how to ALTER USER to both set a password and change a password. However, I can't seem to *remove* a password. Setting it to '' does not work as intended; on the next login, psql asks for a password and fails no matter what I do. I've been through the files in /usr/share/doc/postgresql* and the manual, with no joy. Any hints? Thanks! -- Rodolfo J. Paiz <rpaiz@simpaticus.com>
"Rodolfo J. Paiz" <rpaiz@simpaticus.com> writes: > I have learned how to ALTER USER to both set a password and change a > password. However, I can't seem to *remove* a password. AFAIR this isn't supported directly. You can get the effect in two ways though: 1. (language lawyer's way) ALTER USER luser WITH VALID UNTIL 'yesterday'; The password is still there, but no longer usable. 2. (hacker's way) UPDATE pg_shadow SET passwd = NULL WHERE usename = 'luser'; This really does reset the password, but it involves more intimacy with the current system catalog representation than you might like --- ie, it might possibly break in some future version of Postgres. regards, tom lane
On Mon, 2005-01-24 at 22:39 -0500, Tom Lane wrote: > "Rodolfo J. Paiz" <rpaiz@simpaticus.com> writes: > > I have learned how to ALTER USER to both set a password and change a > > password. However, I can't seem to *remove* a password. > > AFAIR this isn't supported directly. You can get the effect in two ways > though: > Just about what I wanted to know, thanks! The hacker's solution will do for today. In the future, I'm simply going to use user passwords on the production server and put my personal notebook's postmaster on "trust". Cheers, -- Rodolfo J. Paiz <rpaiz@simpaticus.com>