Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
84b8fcaa
Commit
84b8fcaa
authored
13 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Adjust pg_upgrade "new database skip" code, e.g. 'postgres', to more
cleanly handle old/new database mismatches.
parent
7ed36056
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/pg_upgrade/relfilenode.c
+11
-9
11 additions, 9 deletions
contrib/pg_upgrade/relfilenode.c
with
11 additions
and
9 deletions
contrib/pg_upgrade/relfilenode.c
+
11
−
9
View file @
84b8fcaa
...
...
@@ -41,11 +41,10 @@ transfer_all_new_dbs(DbInfoArr *old_db_arr,
/* Scan the old cluster databases and transfer their files */
for
(
old_dbnum
=
new_dbnum
=
0
;
old_dbnum
<
old_db_arr
->
ndbs
&&
new_dbnum
<
new_db_arr
->
ndbs
;
old_dbnum
<
old_db_arr
->
ndbs
;
old_dbnum
++
,
new_dbnum
++
)
{
DbInfo
*
old_db
=
&
old_db_arr
->
dbs
[
old_dbnum
];
DbInfo
*
new_db
=
&
new_db_arr
->
dbs
[
new_dbnum
];
DbInfo
*
old_db
=
&
old_db_arr
->
dbs
[
old_dbnum
],
*
new_db
;
FileNameMap
*
mappings
;
int
n_maps
;
pageCnvCtx
*
pageConverter
=
NULL
;
...
...
@@ -55,13 +54,16 @@ transfer_all_new_dbs(DbInfoArr *old_db_arr,
* but not in the old, e.g. "postgres". (The user might
* have removed the 'postgres' database from the old cluster.)
*/
while
(
strcmp
(
old_db
->
db_name
,
new_db
->
db_name
)
!=
0
&&
new_dbnum
<
new_db_arr
->
ndbs
)
new_db
=
&
new_db_arr
->
dbs
[
++
new_dbnum
];
for
(;
new_dbnum
<
new_db_arr
->
ndbs
;
new_dbnum
++
)
{
new_db
=
&
new_db_arr
->
dbs
[
new_dbnum
];
if
(
strcmp
(
old_db
->
db_name
,
new_db
->
db_name
)
==
0
)
break
;
}
if
(
strcmp
(
old_db
->
db_name
,
new_db
->
db
_name
)
!=
0
)
pg_log
(
PG_FATAL
,
"old
and new databases have different names: old
\"
%s
\"
, new
\"
%s
\"
\n
"
,
old_db
->
db_name
,
new_db
->
db_name
);
if
(
new_dbnum
>=
new_db
_arr
->
n
db
s
)
pg_log
(
PG_FATAL
,
"old
database
\"
%s
\"
not found in the new cluster
\n
"
,
old_db
->
db_name
);
n_maps
=
0
;
mappings
=
gen_db_file_maps
(
old_db
,
new_db
,
&
n_maps
,
old_pgdata
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment