Skip to content
masterclass Buddy

PostgreSQL · Command

psql

psql is PostgreSQL's terminal client. It runs SQL interactively or from files and command-line arguments, and it also provides psql-specific commands for scripting.

Last updated

Syntax

psql [ option ...] [ dbname [ username ]]

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • \d
  • \connect
  • \i
  • \list
  • \pset
  • ON_ERROR_STOP
  • PGHOST
  • PGPORT

Source: PostgreSQL: Documentation: 18: psql. Checked 2026-11-03.