psql -d gpdatabase -h master_host -p 5432 -U gpadmin
psql -d postgres -h [host] -p [port] -U [user]
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
psql dbname postgres
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>
import sqlalchemy
engine = sqlalchemy.create_engine('postgresql://username:password@localhost/mydatabase')