HostOnNet Blog


PostgreSQL Change User Password

postgreSQL

Create A User

To create user in PostgreSQL, run

sudo -u postgres -i
createuser -s <username>
exit

Change User Password

sudo -u postgres -i
psql
ALTER USER USER-NAME-HERE WITH PASSWORD 'PASSWORD-HERE';
\q
exit

OR

root@maps:~# sudo -u postgres -i
postgres@maps:~$ psql
psql (9.3.10)
Type "help" for help.

postgres-# \password USER-NAME-HERE
Enter new password: 
Enter it again: 
postgres-#

Posted in Linux