admin user password set postgresqll code example
Example 1: set username and password for postgresql database
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
Example 2: postgres create admin user with password
sudo -u postgres createuser -s -i -d -r -l -w <<username>>
sudo -u postgres psql -c "ALTER ROLE <<username>> WITH PASSWORD '<<password>>';"