Creating a copy of a database in PostgreSQL.

This commit is contained in:
Morgan 2019-10-12 14:13:25 +02:00 committed by GitHub
parent e9fa0e2512
commit ebc8533f05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,6 +57,9 @@ If you're using CLI and you're a postgres user, then you can do this:
### Creating a copy of a database in PostgreSQL. ### Creating a copy of a database in PostgreSQL.
``` ```
pg_dumpall > db.out # backup # backup
psql -f db.out postgres # restore (might requires some DROP DATABASE xxx if you do want to replace existing data with same db and table names. pg_dumpall > db.out
# restore
# (might requires some DROP DATABASE xxx if you do want to replace existing data with same db and table names.
psql -f db.out postgres
``` ```