command line connect to postgresql code example
Example 1: ubuntu connect to postgres
sudo su - postgres
Example 2: postgresql connect to database command line
user@user-pc:~$ sudo -i -u postgres
postgres@user-pc:~$ psql
psql (9.3.5, server 9.3.6)
Type "help" for help.