Skip to content

Instantly share code, notes, and snippets.

@rajbharath
Last active August 29, 2015 14:26
Show Gist options
  • Save rajbharath/7b0c1b4711b8fbc41953 to your computer and use it in GitHub Desktop.
Save rajbharath/7b0c1b4711b8fbc41953 to your computer and use it in GitHub Desktop.
PSQL Commands

list of databases in a Postgresql:

  • \l

list of all the tables in a Postgresql database:

  • \d

turn on timing, and checking how much time a query takes to execute:

  • \timing

list of available functions:

  • \df
  • \df+

edit PostgreSQL queries:

  • \e

postgreSQL history file:

  • cat ~/.psql_history

align/unalign output format:

  • /a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment