psql

PostgreSQL's interactive command-line client for running SQL statements.

In more detail

The -U flag picks the user and -c runs one statement and exits. Without -c it opens an interactive prompt.

Example

docker exec m06l01-db psql -U postgres -c "SELECT count(*) FROM orders"

Related terms

Taught in

References