Backup and Restore is probably the most important thing to know how to do when you have a database with data you care about.
The utilities in PostgreSQL that accomplish these tasks are pg_restore, pg_dump, pg_dumpall, and for restore of plain text dumps - psql.
A lot of the switches used by pg_dump, pg_restore, pg_dumpall are common to all three and on rare cases, the switches used by each overlap but mean different things.
pg_dump and pg_restore are complementary. You use pg_dump to do hot backups of a database and pg_restore to restore it either to another database or to recover portions of a database.
Rather than trying to keep track of which switch works with which, we decided to combine all into a single cheat sheet with a column denoting which utility the switch is supported in.
Pretty much all the text is compiled from the --help switch of each.
Below is a Thumbnail view of the PostgreSQL 8.3 Dump Restore cheat sheet
that covers PostgreSQL 8.3 pg_dump, pg_dumpall, pg_restore utilities.
PDF Portrait version 8.5 x 11" of this cheatsheet is available at PostgreSQL 8.3 Dump Restore 8.5 x 11 and also available in
PDF A4 format and HTML.
One of the nice things about the PostgreSQL command-line restore tool is the ease with which you can restore select objects from a backup. We tend to use schemas for logical groupings which are partitioned by context, time, geography etc. Often times w
Tracked: Sep 07, 13:58
We've been busy as of late, so has been hard to keep up with blogging. As many of you may notice, we have another satellite site called Postgres OnLine Journal. We try to put only PostgreSQL specific things on that site and PostGIS/GIS things on thi
Tracked: Sep 14, 10:00
Tracked: Nov 21, 20:38