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
692b8373
Commit
692b8373
authored
25 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Fix pg_upgrade so it vacuums all databases.
parent
008ef1de
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/bin/pg_dump/pg_upgrade
+10
-9
10 additions, 9 deletions
src/bin/pg_dump/pg_upgrade
with
10 additions
and
9 deletions
src/bin/pg_dump/pg_upgrade
+
10
−
9
View file @
692b8373
...
@@ -3,7 +3,7 @@
...
@@ -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/src/bin/pg_dump/Attic/pg_upgrade,v 1.1
2
1999/09/28 1
6
:0
2:2
8 momjian Exp $
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_upgrade,v 1.1
3
1999/09/28 1
8
:0
4:1
8 momjian Exp $
#
#
# NOTE: we must be sure to update the version-checking code a few dozen lines
# NOTE: we must be sure to update the version-checking code a few dozen lines
# below for each new PostgreSQL release.
# below for each new PostgreSQL release.
...
@@ -100,23 +100,24 @@ esac
...
@@ -100,23 +100,24 @@ esac
# OK, ready to proceed.
# OK, ready to proceed.
# XXX Do I need to create a database?
# remove any COPY statements, except for the one that loads pg_shadow.
# Remove any COPY statements, except for the one that loads pg_shadow.
# there shouldn't be any others in there anyway...
# There shouldn't be any others in there anyway...
# Also marks rows as committed because when pg_log is replaced with
# the saved version, the transaction statuses may be wrong, so
# vacuum sets the on-row status to the proper value.
cat
$INPUT
|
awk
' {
cat
$INPUT
|
awk
' {
if (toupper($1) == "COPY" && $2 != "pg_shadow")
if (toupper($1) == "COPY" && $2 != "pg_shadow")
while (getline $0 > 0 && $0 != "\\.")
while (getline $0 > 0 && $0 != "\\.")
;
;
else if (tolower($1) == "\\connect" &&
tolower($2) == "template1")
printf "VACUUM;\n%s\n", $0;
else print $0;
else print $0;
}'
>
/tmp/
$$
}'
>
/tmp/
$$
# Add a VACUUM command to the end of the pg_dump script. With MVCC,
# We need to vacuum the last database too
# this is necessary to ensure that all the rows in the new database's
# system tables will still be considered committed after we overwrite
# pg_log with the old database's commit log...
echo
"VACUUM;"
>>
/tmp/
$$
echo
"VACUUM;"
>>
/tmp/
$$
# Create and vacuum empty tables/indexes
# Create and vacuum empty tables/indexes
...
...
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