Resetting the password for postgres user

The authentification is defined in

To allow password authentication:

local   all             postgres                                md5

To allow user authentication:

local   all             postgres                                peer

With user authentication, you can then connect as user postgres:

sudo -u postgres psql

At the psql shell, alter the password

ALTER USER postgres with password 'newpassword';

And you can quit the shell with \q. Don't forget to reload the config with:

sudo service postgresqlf reload

switch the configuration back to have password based authentication.

  • Created: 20/04/14 22:43
  • Modified: 20/04/14 22:43