version 1, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
POSTGRESQL-DUMP |
|
|
2 |
!!!POSTGRESQL-DUMP |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
OPTIONS |
|
|
7 |
SEE ALSO |
|
|
8 |
BUGS |
|
|
9 |
AUTHOR |
|
|
10 |
---- |
|
|
11 |
!!NAME |
|
|
12 |
|
|
|
13 |
|
|
|
14 |
postgresql-dump - a utility to dump and destroy a PostgreSQL database when the database format becomes incompatible with a previous version. |
|
|
15 |
!!SYNOPSIS |
|
|
16 |
|
|
|
17 |
|
|
|
18 |
__/usr/lib/postgresql/bin/postgresql-dump [[-b blocksize] |
|
|
19 |
[[-c] [[-d] [[-e encoding] [[-f] [[-i] [[-l] [[-p directory] -t |
|
|
20 |
target_file [[-v] [[-x|-X]__ |
|
|
21 |
!!DESCRIPTION |
|
|
22 |
|
|
|
23 |
|
|
|
24 |
__postgreql-dump__ is used to dump and reload the whole |
|
|
25 |
PostgreSQL database when the database format has changed |
|
|
26 |
between releases and become incompatible. It tests for this |
|
|
27 |
situation by reading the version file in the top-level |
|
|
28 |
directory of the PostgreSQL database. |
|
|
29 |
|
|
|
30 |
|
|
|
31 |
The trace of the program output is sent to standard output |
|
|
32 |
or standard error. |
|
|
33 |
|
|
|
34 |
|
|
|
35 |
If there is an incompatibility between the database version |
|
|
36 |
of the current PostgreSQL programs and that of the database |
|
|
37 |
itself, this program must be used to dump the database to an |
|
|
38 |
ASCII file. (This may be a tape device.) |
|
|
39 |
|
|
|
40 |
|
|
|
41 |
If the -d option is used, the entire contents of the |
|
|
42 |
database directory are then deleted. They may be preserved |
|
|
43 |
in another location, with the -p option, should you have |
|
|
44 |
both the desire and the spare disk capacity. |
|
|
45 |
|
|
|
46 |
|
|
|
47 |
__Postgresql-dump__ may only be run by the user |
|
|
48 |
__postgres__ (the postgresql superuser). |
|
|
49 |
!!OPTIONS |
|
|
50 |
|
|
|
51 |
|
|
|
52 |
''-b blocksize'' |
|
|
53 |
|
|
|
54 |
|
|
|
55 |
Specify the blocksize for writing the dump to ''target.'' |
|
|
56 |
This is only useful for output to a tape drive; it makes the |
|
|
57 |
script use dd to write to the target, instead of redirecting |
|
|
58 |
standard output. |
|
|
59 |
|
|
|
60 |
|
|
|
61 |
''-c'' |
|
|
62 |
|
|
|
63 |
|
|
|
64 |
After the dump has been written, copy it to screen through |
|
|
65 |
the filter named in PAGER (or __more,__ by default) and |
|
|
66 |
ask the user to give confirmation before deleting the |
|
|
67 |
database files. |
|
|
68 |
|
|
|
69 |
|
|
|
70 |
''-d'' |
|
|
71 |
|
|
|
72 |
|
|
|
73 |
Destroy the database files after dumping the database. This |
|
|
74 |
option must be used when a new, incompatible release of |
|
|
75 |
PostgreSQL is loaded. |
|
|
76 |
|
|
|
77 |
|
|
|
78 |
''-e encoding'' |
|
|
79 |
|
|
|
80 |
|
|
|
81 |
Force the default encoding to be ''encoding'' instead of |
|
|
82 |
its current value. This will not affect the encoding of |
|
|
83 |
existing databases, but will be used whenever a new database |
|
|
84 |
is created without a specific encoding's being |
|
|
85 |
specified. |
|
|
86 |
|
|
|
87 |
|
|
|
88 |
''-f'' |
|
|
89 |
|
|
|
90 |
|
|
|
91 |
Fix rules from earlier versions to the 6.5 (and later) |
|
|
92 |
standard. This filters the dump file through |
|
|
93 |
|
|
|
94 |
|
|
|
95 |
''-F'' |
|
|
96 |
|
|
|
97 |
|
|
|
98 |
Force an upgrade, even though the database version number is |
|
|
99 |
apparently up to date. This may be needed between beta |
|
|
100 |
releases that require an initdb even though the version |
|
|
101 |
number does not change. |
|
|
102 |
|
|
|
103 |
|
|
|
104 |
''-i'' |
|
|
105 |
|
|
|
106 |
|
|
|
107 |
Create a new database with __initdb.__ This requires the |
|
|
108 |
option __-d.__ |
|
|
109 |
|
|
|
110 |
|
|
|
111 |
''-l'' |
|
|
112 |
|
|
|
113 |
|
|
|
114 |
Load the dump into a new database. This option requires the |
|
|
115 |
__-i__ option. |
|
|
116 |
|
|
|
117 |
|
|
|
118 |
''-p directory'' |
|
|
119 |
|
|
|
120 |
|
|
|
121 |
This option can only be used with __-d__. Instead of |
|
|
122 |
destroying the database files, the program moves them under |
|
|
123 |
''directory'', creating it, if necessary. |
|
|
124 |
''Directory'' must not be the same directory as, or |
|
|
125 |
underneath the directory named in the environment variable, |
|
|
126 |
PGDATA. |
|
|
127 |
|
|
|
128 |
|
|
|
129 |
''-t target'' |
|
|
130 |
|
|
|
131 |
|
|
|
132 |
This option is always required. ''Target'' is the file or |
|
|
133 |
tape to which the ASCII dump should be written. It is |
|
|
134 |
incorrect to name any physical device other than a tape. It |
|
|
135 |
is not possible (or, at least, meaningful) to use a tape |
|
|
136 |
with the -c option and also to start the dump in the middle |
|
|
137 |
of the tape. ''Target'' must not be the same directory |
|
|
138 |
as, or underneath the directory named in the environment |
|
|
139 |
variable, __PGDATA.__ |
|
|
140 |
|
|
|
141 |
|
|
|
142 |
''-v'' |
|
|
143 |
|
|
|
144 |
|
|
|
145 |
Print more information about what the script is |
|
|
146 |
doing. |
|
|
147 |
|
|
|
148 |
|
|
|
149 |
''-X'' |
|
|
150 |
|
|
|
151 |
|
|
|
152 |
Prevents dumping the old database; use of this option |
|
|
153 |
overrides -x and -c. It is intended for use by the Debian |
|
|
154 |
post-installation script. |
|
|
155 |
|
|
|
156 |
|
|
|
157 |
''-x'' |
|
|
158 |
|
|
|
159 |
|
|
|
160 |
Prevents dumping the old database; use of this option forces |
|
|
161 |
-c. |
|
|
162 |
!!SEE ALSO |
|
|
163 |
|
|
|
164 |
|
|
|
165 |
''initdb, pg_dump, pg_dumpall, pg_upgrade'' |
|
|
166 |
!!BUGS |
|
|
167 |
|
|
|
168 |
|
|
|
169 |
The program does not check that a device is really a tape. |
|
|
170 |
If you send the dump to the screen, for instance, and also |
|
|
171 |
use __-d,__ without __-c,__ you will destroy your |
|
|
172 |
database irrecoverably. |
|
|
173 |
!!AUTHOR |
|
|
174 |
|
|
|
175 |
|
|
|
176 |
postgresql-dump was written for Debian GNU/Linux by Oliver |
|
|
177 |
Elphick |
|
|
178 |
---- |