Hacker News new | ask | show | jobs
by AlterEgo20 3886 days ago
Backup: 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....

In short:

  pg_restore -C -d postgres db.dump
Command directly from the shell:

  psql -c "psql command"
1 comments

and 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