ArcGIS Server Banner

Recovery models for PostgreSQL

Recovery models for PostgreSQL

Release 9.3 E-mail This TopicPrintable VersionGive Us feedback
To restore a database from an archive file created using the pg_dump command, use the pg_restore command.

-Database names must be unique on the PostgreSQL instance, so you should drop the old database.

dropdb mypgdb –U sde

-Re-create the database.

createdb mypgdb –E UTF8 –D <tablespace> –U sde

Then restore the database using the pg_restore command.

pg_restore –d mypgdb mypgdb1031.dump –U sde

You can specify ––exit on error with pg_restore to cause psql to exit when it encounters a SQL error during the restore.

Tip

See Also

  • PostgreSQL backups
  • About database backup and recovery