---
name: "postgis_restore"
section: "1"
platform: "linux"
package: "postgis"
version: "3.6.4-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/postgis_restore"
---

# postgis\_restore(1)

restore a PostGIS database from an archive file created by pg\_dump

## NAME

postgis\_restore - restore a PostGIS database from an archive file created by pg\_dump

## SYNTAX

postgis\_restore \[*-v*\] \[*-L TOC*\] \[*-s schema*\] *dumpfile*

## DESCRIPTION

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

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

## EXAMPLES

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

## AUTHORS

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

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