File: postgis_restore.1

package info (click to toggle)
postgis 3.5.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 69,528 kB
  • sloc: ansic: 162,229; sql: 93,970; xml: 53,139; cpp: 12,646; perl: 5,658; sh: 5,369; makefile: 3,435; python: 1,205; yacc: 447; lex: 151; pascal: 58
file content (52 lines) | stat: -rw-r--r-- 1,350 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
.TH "postgis_restore" "1" "" "" "PostGIS"
.SH "NAME"
.LP
postgis_restore - restore a PostGIS database from an archive file created by pg_dump

.SH "SYNTAX"
.LP
postgis_restore [\fI-v\fR] [\fI-L TOC\fR] [\fI-s schema\fR] \fIdumpfile\fR

.SH "DESCRIPTION"
.LP
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 \fICREATE EXTENSION\fR will not have PostGIS objects in them so can
safely be restored directly using \fIpg_restore\fR.

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

.SH "USAGE"
.LP
Usage information is printed when the script is invoked with no
arguments.

.SH "EXAMPLES"
.LP

Create a custom dump from \fIolddb\fR:

	pg_dump -Fc olddb > olddb.dump

Create a new database \fInewdb\fR:

	createdb newdb

PostGIS-enable the new database:

	psql -c 'CREATE EXTENSION postgis' newdb

Restore your data:

	postgis_restore.pl olddb.dump | psql newdb

.SH "AUTHORS"
.LP
Originally written by Sandro Santilli <strk@kbt.io>.

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