Skip to content

Instantly share code, notes, and snippets.

@bruceh48
Last active April 9, 2016 08:45
Show Gist options
  • Save bruceh48/0e17ff2db16ccd9e4998c956c194c6e1 to your computer and use it in GitHub Desktop.
Save bruceh48/0e17ff2db16ccd9e4998c956c194c6e1 to your computer and use it in GitHub Desktop.
Dump and Restore Single Postgres Table
pg_dump --host localhost --port 5432 --username USERNAME DBNAME --format plain -ignore-version --file dumpfile.sql --table THE_TABLENAME
su - postgres
psql -l # will list all databases on Postgres cluster
pg_restore -d DBNAME -U postgres /srv/dir/dumpfile.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment