Source: http://sharadchhetri.com/2015/07/15/set-postgres-password-on-postgresql-9-4/
Switcher vers l'utilisateur postgres
marc@ubuntu:~$ sudo su - postgres
Vérifier qu'on est bien sur l'utilisateur postgres :
postgres@ubuntu:~$ whoami postgres
Lancer psql et modifier le mot de passe avec la commande \password username :
postgres@ubuntu:~$ psql psql (9.3.10) Type "help" for help. postgres=# \password postgres Enter new password: Enter it again: postgres=# \q
Revenir à l'utilisateur normal:
postgres@ubuntu:~$ exit