Last active
December 8, 2017 10:43
-
-
Save DevanR/f825c4916b3253de707b835cb5a5fa4e to your computer and use it in GitHub Desktop.
Dump and Restore Postres tables
This file contains 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
# 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