Last active
April 27, 2021 20:27
Revisions
-
jeremykendall revised this gist
Sep 25, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -20,5 +20,5 @@ This syntax allows importing to a database with the name of your choice. ## Reference * [`pg_dump` documentation](http://www.postgresql.org/docs/9.4/static/app-pgdump.html) * [`pg_restore` documentation](http://www.postgresql.org/docs/9.4/static/app-pgrestore.html) -
jeremykendall revised this gist
Sep 25, 2015 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ `pg_dump -U [superuser] -Fc [dbname] > db.dump` ## Import @@ -18,4 +18,7 @@ This syntax allows importing to a database with the name of your choice. `pg_restore --clean --if-exists --no-acl --no-owner --verbose -d [dbname] -U [superuser] db.dump` ## Reference [`pg_dump` documentation](http://www.postgresql.org/docs/9.4/static/app-pgdump.html) [`pg_restore` documentation](http://www.postgresql.org/docs/9.4/static/app-pgrestore.html) -
jeremykendall created this gist
Sep 25, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ # Postgres Export and Import ## Export `pg_dump -U [superuser] -Fc [dbname] > db.dump` [`pg_dump` documentation](http://www.postgresql.org/docs/9.4/static/app-pgdump.html) ## Import This syntax allows importing to a database with the name of your choice. ### Create the database (if it does not exist): `createdb -T template0 [dbname]` ### Import: `pg_restore --clean --if-exists --no-acl --no-owner --verbose -d [dbname] -U [superuser] db.dump` [`pg_restore` documentation](http://www.postgresql.org/docs/9.4/static/app-pgrestore.html)