4 ms·
Backup: http://www.postgresql.org/docs/current/static/app-pgdump.html http://www.postgresql.org/docs/current/static/app-pgdump.htm... In short: pg_dump -Fc
by AlterEgo20 11y ago
Backup: http://www.postgresql.org/docs/current/static/app-pgdump.html http://www.postgresql.org/docs/current/static/app-pgdump.htm...
In short:
pg_dump -Fc mydb > db.dump
Restore: http://www.postgresql.org/docs/current/static/app-pgrestore.html http://www.postgresql.org/docs/current/static/app-pgrestore....
In short:
pg_restore -C -d postgres db.dump
Command directly from the shell:
psql -c "psql command"
- y4mi 11y agoand the default dumps are simple sql files, which you can actually pipe to another server. pg_dump -C mydb | psql -h ${some_other_server} mydb