Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit37953b2

Browse files
committed
Add pg_upgrade TESTING files explaining a testing method.
1 parent11f2efd commit37953b2

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

‎contrib/pg_upgrade/TESTING

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
The most effective way to test pg_upgrade, aside from testing on user
2+
data, is by upgrading the PostgreSQL regression database.
3+
4+
This testing process first requires the creation of a valid regression
5+
database dump. Such files contain most database features and are
6+
specific to each major version of Postgres.
7+
8+
Here are the steps needed to create a regression database dump file:
9+
10+
1) Create and populate the regression database in the old cluster
11+
This database can be created by running 'gmake installcheck' from
12+
src/test/regression.
13+
14+
2) Use pg_dump to dump out the regression database
15+
Use the new cluster's pg_dump on the old database to minimize
16+
whitespace differences in the diff.
17+
18+
3) Adjust the regression database dump file
19+
20+
a) Change CREATE FUNCTION shared object paths to use '$libdir'
21+
The old and new cluster will have different shared object paths.
22+
23+
b) Remove 'regex_flavor' (not supported in Postgres 9.0)
24+
25+
c) Change CREATE OR REPLACE LANGUAGE to CREATE LANGUAGE
26+
The former syntax is only supported in Postgres 9.0.
27+
28+
d) Perform the load/dump twice
29+
This fixes problems with the ordering of COPY columns for
30+
inherited tables.
31+
32+
e) Fix any wrapping format differences
33+
Commands like CREATE TRIGGER and ALTER TABLE sometimes have
34+
differences.
35+
36+
f) Adjust extra_float_digits
37+
Postgres 9.0 pg_dump uses extra_float_digits=-2 for pre-9.0
38+
databases, and extra_float_digits=-3 for >= 9.0 databases.
39+
It is necessary to modify 9.0 pg_dump to always use -3, and
40+
modify the pre-9.0 old server to accept extra_float_digits=-3.
41+
42+
Once the dump is created, it can be repeatedly loaded into the old
43+
database, upgraded, and dumped out of the new database, and then
44+
compared to the original version. To test the dump file, perform these
45+
steps:
46+
47+
1) Create the old and new clusters in different directories.
48+
49+
2) Copy the regression shared object files into the appropriate /lib
50+
directory for old and new clusters.
51+
52+
3) Create the regression database in the old server.
53+
54+
4) Load the dump file created above into the regression database;
55+
check for errors while loading.
56+
57+
5) Upgrade the old database to the new major version, as outlined in
58+
the pg_upgrade manual section.
59+
60+
6) Use pg_dump to dump out the regression database in the new cluster.
61+
62+
7) Diff the regression database dump file with the regression dump
63+
file loaded into the old server.
64+
65+
66+
67+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp