Last active
August 29, 2015 14:06
-
-
Save brianlittmann/0111e43d86ce65c86935 to your computer and use it in GitHub Desktop.
Replace data in a single PG 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
### Source | |
# shell: | |
pg_dump -U username --data-only --table=tablename dbname > tablename.sql | |
### Target | |
# psql: | |
delete from tablename *; | |
# shell: | |
psql -U username dbname < tablename.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment