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)

AWS Security LIVE!

Tune in for AWS Security LIVE!

Join AWS Security LIVE! for expert insights and actionable tips to protect your organization and keep security teams prepared.

Learn More

πŸ‘‹ Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay