Last active
April 9, 2016 08:45
-
-
Save bruceh48/0e17ff2db16ccd9e4998c956c194c6e1 to your computer and use it in GitHub Desktop.
Dump and Restore Single Postgres Table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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