Last active
April 21, 2016 00:12
-
-
Save ofirgeller/989e87ff76f77ff46522 to your computer and use it in GitHub Desktop.
create a schme copy of a postgres database (on window)
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
set PGPASSWORD="<password>"; | |
pg_dump -d "<database name>" -h "localhost" -p "5432" -U "postgres" --clean --create --schema-only --file "db_schema_copy" --format custom; | |
dropdb --if-exists -U postgres "<test database name>"; | |
createdb -U "postgres" "<test database name>"; | |
pg_restore.exe -U postgres -d "<test database name>" .\db_schema_copy; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment