1user@user-pc:~$ sudo -i -u postgres
2postgres@user-pc:~$ psql
3psql (9.3.5, server 9.3.6)
4Type "help" for help.
5
1For Windows users using the SQL shell
2
3\c DB_NAME USER_NAME HOST PORT
4
5// to get the connection details such as your username, host and port simply use the "\conninfo" command
6
7eg : \c test1 john_doe localhost 5432