Check out example codes for "set username and password for postgresql database". It will help you in understanding the concepts better.

Code Example 1

sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';"

Learn ReactJs, React Native from akashmittal.com