OnCallReady

Commands

psql - PostgreSQL interactive terminal (simulator: the lab's minimal client for pg.lab)

psql [OPTION]... [DBNAME [USERNAME]] | psql postgresql://USER:PASSWORD@HOST:5432/DB

Options you will use

-p, --port=PORT
database server port (default 5432).
-U, --username=USER
database user name.
-d, --dbname=DBNAME
database name to connect to.
-c, --command=COMMAND
run only a single command (SQL or internal) and exit.
-W, --password
force password prompt.
-A
unaligned table output mode.
-t
print rows only.
-At
unaligned rows only: what scripts use.
-V, --version
output version information, then exit.

Examples

$ PGPASSWORD=$PW psql -h pg.lab -U $USER -d orders -c 'SELECT current_user;'

log in with Vault's dynamic credentials

$ psql -h pg.lab -U vault -d orders -c '\du'

list roles (Vault's v-... users)

Gotchas

Try psql in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.