There is nothing on this server to connect with

pg-cmd » Use cases » Nothing installed

Download pg-cmd Free Trial »     Buy pg-cmd Now »

The situation

A production or customer server, reached over SSH or a remote session, where you need to look at PostgreSQL - and where installing anything is not an option. No package manager rights, no administrator to approve a client, no change ticket for "put a database client on the server". Sometimes the machine is not even allowed outbound traffic to fetch a package.

What the machine does have is a terminal, a filesystem and a network route to the database.

What you do

  1. Copy pg-cmd to the server - it is a single executable that runs from the folder it sits in. No PostgreSQL client, no DLL files, no system environment configuration.
  2. Run it. The interactive interface opens in the terminal you are already using.
  3. Connect: connect user:password@host:5432/database - host, port, user and schema in one line.
  4. Work: browse the objects, run a query, import or export a file. Everything happens over the connection the machine already has.

Running pg-cmd on a Linux server with nothing else installed

Because nothing has to be installed, the same copy can be left in a tools folder on any number of servers, and removing it is deleting a file. That is the difference between "someone has to approve a client package" and "I looked at it in two minutes".

What it will not do

Related

The modes: connecting, interactive mode, the guide. Working in a script instead: use it in a shell script. Moving data: JSON and CSV in and out. One copy for every platform: the same commands everywhere.