psql how to connect to database code example
Example 1: 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.
Example 2: psql connect to another database
\c DBNAME
\connect DBNAME