GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
postgis_restore(1) PostGIS postgis_restore(1)

postgis_restore - restore a PostGIS database from an archive file created by pg_dump

postgis_restore [-v] [-L TOC] [-s schema] dumpfile

The postgis_restore command allows extracting SQL statements to re-create objects found in a custom dump of a PostGIS-enabled database while skipping the PostGIS specific objects.

This is only useful for dumps of databases in which PostGIS was enabled by loading the postgis.sql script. Dumps taken from databases in which PostGIS was enabled via CREATE EXTENSION will not have PostGIS objects in them so can safely be restored directly using pg_restore.

Note that this command only works with dumps using the custom format, which are those created with pg_dump -Fc.

Usage information is printed when the script is invoked with no arguments.

Create a custom dump from olddb:

pg_dump -Fc olddb > olddb.dump

Create a new database newdb:

createdb newdb

PostGIS-enable the new database:

psql -c 'CREATE EXTENSION postgis' newdb

Restore your data:

postgis_restore.pl olddb.dump | psql newdb

Originally written by Sandro Santilli <strk@kbt.io>.

More information is available at http://postgis.net


Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.