Created
November 26, 2019 13:56
-
-
Save moraisaugusto/c1d6cd2c6d0dd67b03f2d9119d095539 to your computer and use it in GitHub Desktop.
Postgresql - Dump and Restore
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
# to perform a dump with only the Data, not the schema ( using SSL) | |
$ PGSSLMODE=allow pg_dump -v -Fc --data-only -h HOST -p 5432 -U USERNAME DB_NAME --exclude-table-data NOT_THIS_TABLE > testing-data-only.sql | |
# to restore the dump | |
$ pg_restore -h localhost -p 5432 -U USERNAME -d DB_NAME < testing-data-only.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment