AshKeys

Confessions and Confusions of Ashok M A. Personal and Professional Blog.

Ashok Mannolu Arunachalam, PostgresLinuxPop!_OS
Back

How to install postgres client in linux

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

shell
$ sudo apt-get install postgresql-client

This installs psql bin with other utilities such as, pg_dump.

Verifying the installation

shell
$ psql --version
$ psql (PostgreSQL) 12.5 (Ubuntu 12.5-0ubuntu0.20.10.1)

Connecting to a database

shell
$ 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.