Skip to content

Instantly share code, notes, and snippets.

@brianlittmann
Last active August 29, 2015 14:06
Show Gist options
  • Save brianlittmann/0111e43d86ce65c86935 to your computer and use it in GitHub Desktop.
Save brianlittmann/0111e43d86ce65c86935 to your computer and use it in GitHub Desktop.
Replace data in a single PG table.
### 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