psql login with user code example
Example 1: how to connect postgres user password using command line
sudo -u postgres psql postgres
Example 2: how to login using a particular user postrges
psql -d mydb -U myuser -W
psql -h myhost -d mydb -U myuser -W
Example 3: psql create user
# https://www.postgresql.org/docs/8.0/sql-createuser.html
CREATE USER <username> WITH PASSWORD '<password>' VALID UNTIL '<date here>';
Example 4: how to connect postgres user password using command line
\password postgres