Quickzi: How To Change PostgreSQL Root Password
Here is how to change the PostgreSQL root password from the Linux command line. Replace “root” with any user name to change any password. It is important to note that PostgreSQL does not have an actual “root” user name. The “postgres” user is the super-user for PostgreSQL.
# su postgres
# psql -d template1
template1=# ALTER USER postgres WITH PASSWORD '${POSTGRESQL_POSTGRES_PASSWORD}';
You can replace “postgres” with any user name.
Popularity: 28% [?]
Tagged with: HowTo • Linux • postgres • quickzi • tips
Like this post? Subscribe to my RSS feed and get loads more!













This is not the cpmplete picture…. It will only work from the machine where Postgres is installed, and that too only if the pg_hba.conf is configured to ‘trust’ user from the localhost (127.0.0.1).
I have made it work with modifying pg_hba.conf file.