To install via apt:
sudo apt-get install postgresql-client
To connect to a server (azure example):
psql -h myhost.postgres.database.azure.com -d postgres -U username
Move a step ahead in coding
To install via apt:
sudo apt-get install postgresql-client
To connect to a server (azure example):
psql -h myhost.postgres.database.azure.com -d postgres -U username