Postgres backslash commands

When using PostgreSQL or any SQL database for that matter there are a number of useful commands you can use inside of the PostgreSQL terminal that begin with a backslash and are followed with one or two characters. This post is a non-exhaustive list explaining some of those commands.

List all available databases:


Quit from terminal:


List all available tables in a database:


Run the previously executed command:


List previously executed commands:


List of helpful postgres commands:


List all of the schemas of a database:


List all functions:


List all of the tables views:


Love databases more than your dog loves cheese? You might want to check out this post.