Skip to content

Instantly share code, notes, and snippets.

@pmgupte
Last active August 29, 2015 13:56
Show Gist options
  • Save pmgupte/8973689 to your computer and use it in GitHub Desktop.
Save pmgupte/8973689 to your computer and use it in GitHub Desktop.
PSQL commands

#PSQL Commands

To dump data

schema + data

pg_dump -U dbUser --column-inserts --table=tableName

only schema

pg_dump -U dbUser --schema-only --table=tableName

only data

pg_dump -U dbUser --data-only --column-inserts --table=tableName

To import a file into database

psql -U dbUser -d dbName -f fileName

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