Backup and Restore Postgres Database

technical

this compresses with zlib. restore does not take into account for roles, so you’ll need to define them if you plan to restore onto a different location. The restore also tries to define plpgsql which is already present in my situation. it is merely a warning so that is fine.

pg_dump -F c -b -D -f “mydb.sql” mydb

pg_restore -d mydb -F c mydb.sql

Leave a Reply

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>