Skip to content

Instantly share code, notes, and snippets.

@bastman
Last active September 12, 2017 09:24
Show Gist options
  • Save bastman/7ac77544e42e8461c234e1df4f9ab6af to your computer and use it in GitHub Desktop.
Save bastman/7ac77544e42e8461c234e1df4f9ab6af to your computer and use it in GitHub Desktop.
postgres-pgsql-commands
# list databases
$ SELECT datname FROM pg_database WHERE datistemplate = false;
# use database FOO_DB
$ \connect FOO_DB;
# list tables
$ \dt
# SELECT FROM TABLE
$ SELECT * FROM YOUR_TABLE;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment