パスワードのリセット
管理者ユーザのパスワードのリセット
cd /etc/postgresql/9.6/main # (1)
cp pg_hba.conf pg_hba.conf.$(date +%Y%m%d) # (2)
vi pg_hba.conf # (3)
/etc/init.d/postgresql restart # (4)
psql -U postgres # (5)
---------------------------------------------- # (6)
postgres=# ALTER USER postgres with password 'new-pass';
----------------------------------------------
cp pg_hba.conf.20190708 pg_hba.conf # (7)
/etc/init.d/postgresql restart # (8)
参考
https://stackoverflow.com/questions/10845998/i-forgot-the-password-i-entered-during-postgres-installation