Postgres client is handy for a lot of operations you could do against a postgres db, be it local or remote.
Let’s see how we can install one for linux.
Installing postgres client
1 | $ sudo apt-get install postgresql-client |
This installs psql bin with other utilities such as, pg_dump.
Verifying the installation
1 | $ psql --version |
Connecting to a database
1 | $ psql -h ashokma.com -U ashkeys -d ashkeys |
In the above statement, we are trying to make a connection to the database named ashkeys, under the username ashkeys, against the host ashokma.com.