pg_dump dbname > outfileor if you want to clean (drop) schema prior to create (drop databases prior to create):
pg_dump -c dbname > outfileRestore one database:
psql dbname < infileCopy database from one host to another:
pg_dump -h host1 dbname | psql -h host2 dbnameBackup all databases:
pg_dumpall > outfileNote: you can add the --clean option to drop tables before restoring
Restore all databases:
psql -f infile postgres
No comments:
Post a Comment