mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Manual page improvements.
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
# pg_upgrade: update a database without needing a full dump/reload cycle.
|
# pg_upgrade: update a database without needing a full dump/reload cycle.
|
||||||
# CAUTION: Read the manual page before trying to use this!
|
# CAUTION: Read the manual page before trying to use this!
|
||||||
|
|
||||||
# $Header: /cvsroot/pgsql/contrib/pg_upgrade/Attic/pg_upgrade,v 1.8 2002/01/15 05:10:57 momjian Exp $
|
# $Header: /cvsroot/pgsql/contrib/pg_upgrade/Attic/pg_upgrade,v 1.9 2002/01/15 05:41:55 momjian Exp $
|
||||||
#
|
#
|
||||||
# To migrate this to newer versions of PostgreSQL:
|
# To migrate this to newer versions of PostgreSQL:
|
||||||
# 1) Update the version numbers at the top of the file
|
# 1) Update the version numbers at the top of the file
|
||||||
@ -84,11 +84,11 @@ make_dbobjoidmap()
|
|||||||
grep -v '^template0$' |
|
grep -v '^template0$' |
|
||||||
while read DB
|
while read DB
|
||||||
do
|
do
|
||||||
QUERY="`echo \" SELECT relname, oid
|
QUERY="SELECT relname, oid
|
||||||
FROM pg_class
|
FROM pg_class
|
||||||
WHERE relkind = 'r' OR
|
WHERE relkind = 'r' OR
|
||||||
relkind = 'i' OR
|
relkind = 'i' OR
|
||||||
relkind = 't'\"`"
|
relkind = 't'"
|
||||||
# Don't move over 7.1 int4 sequences; use setval() file.
|
# Don't move over 7.1 int4 sequences; use setval() file.
|
||||||
# Sequence XIDs changed from 7.2beta4 to beta5; don't copy them.
|
# Sequence XIDs changed from 7.2beta4 to beta5; don't copy them.
|
||||||
if [ "$SRC_VERSION" != "7.1" -a \
|
if [ "$SRC_VERSION" != "7.1" -a \
|
||||||
|
@ -11,29 +11,31 @@ version.
|
|||||||
.LP
|
.LP
|
||||||
\fBpg_upgrade\fP must be run in two stages. In phase one you must run
|
\fBpg_upgrade\fP must be run in two stages. In phase one you must run
|
||||||
\fBpg_upgrade\fP with your old database installation in place. In phase two,
|
\fBpg_upgrade\fP with your old database installation in place. In phase two,
|
||||||
\fBpg_upgrade\fP must be run on a freshly \fBinitdb\fP'ed current install.
|
\fBpg_upgrade\fP must be run on a freshly \fBinitdb\fP'ed server.
|
||||||
In both phases, the same \fBpg_upgrade\fP script matching the newly installed
|
In both phases, the same newly installed \fBpg_upgrade\fP script must be
|
||||||
version must be used.
|
used.
|
||||||
.SH Upgrading PostgreSQL with pg_upgrade
|
.SH Upgrading PostgreSQL with pg_upgrade
|
||||||
.LP
|
.LP
|
||||||
1) Back up your existing data directory, preferably by making a complete
|
1) Back up your existing data directory, preferably using \fBpg_dumpall.\fP
|
||||||
dump with \fBpg_dumpall.\fP
|
|
||||||
.LP
|
.LP
|
||||||
2) Copy the program \fIpgsql/contrib/pg_upgrade/pg_upgrade\fP from the current
|
2) Copy the program \fIpgsql/contrib/pg_upgrade/pg_upgrade\fP from the current
|
||||||
PostgreSQL distribution somewhere into your path.
|
PostgreSQL distribution somewhere into your path.
|
||||||
.LP
|
.LP
|
||||||
3) Change your working directory to the pgsql main directory, and type:
|
3) Run phase one of \fBpg_upgrade:\fP
|
||||||
.LP
|
.LP
|
||||||
.B $ pg_upgrade -1
|
.B $ pg_upgrade -1
|
||||||
.sp
|
.sp
|
||||||
to collect information about the old database needed for the upgrade.
|
to collect information about the old database needed for the upgrade.
|
||||||
You may use \fI-D\fP to specify the data directory, or use PGDATA.
|
You may use \fI-D\fP to specify the data directory. By default it uses
|
||||||
|
the environment variable \fIPGDATA.\fP
|
||||||
.LP
|
.LP
|
||||||
4) Do:
|
4) Do:
|
||||||
.LP
|
.LP
|
||||||
|
.B $ cd pgsql/src
|
||||||
|
.br
|
||||||
.B $ make install
|
.B $ make install
|
||||||
.sp
|
.sp
|
||||||
to install the new binaries.
|
to install the PostgreSQL binaries for the new release.
|
||||||
.LP
|
.LP
|
||||||
5) Do:
|
5) Do:
|
||||||
.LP
|
.LP
|
||||||
@ -41,8 +43,8 @@ to install the new binaries.
|
|||||||
.br
|
.br
|
||||||
.B $ make install
|
.B $ make install
|
||||||
.sp
|
.sp
|
||||||
to install the \fIpg_resetxlog\fP utility which is needed by
|
to install the \fIpg_resetxlog\fP utility, which is needed during phase
|
||||||
\fBpg_upgrade\fP.
|
2 of \fBpg_upgrade\fP.
|
||||||
.LP
|
.LP
|
||||||
6) Run initdb to create a new template1 database containing the system
|
6) Run initdb to create a new template1 database containing the system
|
||||||
tables for the new release. Make sure you use settings similar to those
|
tables for the new release. Make sure you use settings similar to those
|
||||||
@ -52,17 +54,18 @@ used in your previous version.
|
|||||||
to the server until the upgrade is complete. You may wish to start the
|
to the server until the upgrade is complete. You may wish to start the
|
||||||
postmaster without -i or alter pg_hba.conf temporarily.)
|
postmaster without -i or alter pg_hba.conf temporarily.)
|
||||||
.LP
|
.LP
|
||||||
8) Change your working directory to the pgsql main directory again, and type:
|
8) Run phase two of \fBpg_upgrade:\fP
|
||||||
.LP
|
.LP
|
||||||
.B $ pg_upgrade -2
|
.B $ pg_upgrade -2
|
||||||
.sp
|
.sp
|
||||||
The program will do some checking to make sure everything is properly
|
The program will do some checking to make sure everything is properly
|
||||||
configured, and will then recreate all the databases and tables you had,
|
configured, and will then recreate all your databases and tables,
|
||||||
but with no data. It will then physically move the data files
|
but with no data. It will then physically move the data files
|
||||||
containing non-system tables and indexes into the proper
|
containing non-system tables and indexes into the proper
|
||||||
subdirectories.
|
subdirectories.
|
||||||
.LP
|
.LP
|
||||||
9) Restore your old \fIpg_hba.conf\fP if needed to allow user logins.
|
9) Restore your old \fIpostmaster\fP flags or \fIpg_hba.conf\fP if
|
||||||
|
needed to allow user logins.
|
||||||
.sp
|
.sp
|
||||||
.LP
|
.LP
|
||||||
10) Carefully examine the contents of the upgraded databases. If you
|
10) Carefully examine the contents of the upgraded databases. If you
|
||||||
|
Reference in New Issue
Block a user