Skip to content

Instantly share code, notes, and snippets.

@DevanR
Last active December 8, 2017 10:43
Show Gist options
  • Save DevanR/f825c4916b3253de707b835cb5a5fa4e to your computer and use it in GitHub Desktop.
Save DevanR/f825c4916b3253de707b835cb5a5fa4e to your computer and use it in GitHub Desktop.
Dump and Restore Postres tables
# Dump all table beginning with wholesale from metro
pg_dump -c -t "^wholesale*" -f wholesale.sql metro
# Specific db and user
/usr/pgsql-9.4/bin/pg_dump -c -d<database> -U<user> -t "^wholesale*" -f wholesale.backup
# Clear table in target database
delete from public.wholesale_bearerrate;
# Load data in postgres database
psql metro < wholesale.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment