Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Postgresql Cheat Sheet
Postgresql Cheat Sheet
===============================
start: psql -U username databasename
quit: \q
list all: \d
list tables: \dt
list all databases: \l
describe a table: \d tablename
count rows in table: select count(*) from tablename
EXPORT THE DATABASE
================================
pg_dump -U username -ci -F t -f filename.tar dbname
HEROKU BACKUP AND PUSH
===========================
http://devcenter.heroku.com/articles/taps
heroku db:push
heroku db:push postgres://postgres:mypass@remotehost/mydb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.