DEV Community

Dmitry Romanoff
Dmitry Romanoff

Posted on

Useful psql Commands

\? Command-line reference for psql.
\h SQL Reference: list of available commands or the exact command syntax.
\x Toggles between the regular table display (rows and columns) and an extended display (with each column printed on a separate line). This is useful for viewing several "wide" rows.
\l List of databases.
\du List of users.
\dv List of views.
\df List of functions.
\dn List of schemas.
\dx List of installed extensions.
\dp List of privileges.
\d name Detailed information about the specified object.
\d+ name Extended detailed information about the specified object.
\timing on Displays operator execution time.

Top comments (0)