A screen in front of PostgreSQL, not a prompt

pg-cmd » Use cases » Interactive SQL

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

The situation

Command-line clients are precise and unforgiving. A forgotten quote, a missing semicolon, a flag in the wrong order - each is a new attempt, and each attempt is typed again from memory. When you are exploring an unfamiliar schema, the flag you need is the one you cannot remember.

What is missing is not the power of the command line but the feedback: seeing the objects, seeing the SQL, seeing the result.

What you do

  1. Start pg-cmd - the text interface opens in the terminal.
  2. connect user:password@host:5432/database.
  3. Browse the objects: tables, views and procedures in a searchable list, so you find the name instead of guessing it.
  4. Write SQL in the built-in editor. It highlights syntax as you type, and the result comes back as a table in the same window.

Running a SQL query in pg-cmd's terminal interface

The interface is driven from the keyboard - arrow keys, Enter, Esc - so it works over SSH and in any terminal, including the ones that cannot open a window at all. Long running imports and exports show a progress bar instead of leaving you wondering whether anything is happening.

What it will not do

Related

The mode itself: interactive mode. The result view: viewing results. Non-interactive: shell scripts, batch mode. Connecting first: nothing installed, connecting.