HomePage » Database » PostgreSql » PostgresqlBackup


Postgresql Backup and restore

Reference: http://www.postgresql.org/docs/8.1/static/backup.html

Backup
pg_dumpall | gzip > pgsql.dmp.gz


Backup individual database
for d in `psql -lt | cut -d\| -f1 | grep -v template[01] | grep -v ^$` ;
do
	pg_dump $d > $d.dmp ;
done


Restore
psql database_name < pgsql.dmp

There are no comments on this page. [Add comment]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki