set usernamein postgresql code example
Example 1: set username and password for postgresql database
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
Example 2: postgresql get current user name
SELECT current_user;
sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"
SELECT current_user;