xxxxxxxxxx
for connect to database write: \c databaseName
xxxxxxxxxx
user@user-pc:~$ sudo -i -u postgres
postgres@user-pc:~$ psql
psql (9.3.5, server 9.3.6)
Type "help" for help.
xxxxxxxxxx
#psql -h <host> -p <port> -d <db> -U <user>
psql -h localhost -p 5432 -d <db> -U <user>
xxxxxxxxxx
psql -d geo -h 192.168.1.12 -p 5432 -U supervisor
// geo is a database and supervisor is a user
// Once on postgres you can change the database by typing
\c postgres
xxxxxxxxxx
bash-4.2$ psql -h <hostname or ip address> -p <port number of remote machine> -d <database name which you want to connect> -U <username of the database server>
xxxxxxxxxx
import sqlalchemy
engine = sqlalchemy.create_engine('postgresql://username:password@localhost/mydatabase')