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
4d151d0b
Commit
4d151d0b
authored
23 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
More improvements; still disabled. (Don't panic.)
parent
92a2598f
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
src/bin/pg_dump/pg_upgrade
+34
-12
34 additions, 12 deletions
src/bin/pg_dump/pg_upgrade
with
34 additions
and
12 deletions
src/bin/pg_dump/pg_upgrade
+
34
−
12
View file @
4d151d0b
...
@@ -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.2
0
2002/01/
09 21:50:52
momjian Exp $
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_upgrade,v 1.2
1
2002/01/
10 03:05:48
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.
...
@@ -164,7 +164,7 @@ fi
...
@@ -164,7 +164,7 @@ fi
# Now vacuum each result database in case our transaction increase
# Now vacuum each result database in case our transaction increase
# causes all the XID's to be marked with the frozen XID.
# causes all the XID's to be marked with the frozen XID.
psql
-
l
|
while
read
DB
psql
-
d
template1
-At
-c
"SELECT datname FROM pg_database"
|
while
read
DB
do
do
echo
"VACUUM;"
| psql
"
$DB
"
echo
"VACUUM;"
| psql
"
$DB
"
if
[
$?
-ne
0
]
if
[
$?
-ne
0
]
...
@@ -179,12 +179,16 @@ pg_dumpall -s > $TMPFILE 2>/dev/null
...
@@ -179,12 +179,16 @@ pg_dumpall -s > $TMPFILE 2>/dev/null
# flush buffers to disk
# flush buffers to disk
pg_ctl stop
pg_ctl stop
if
[
"
$?
"
-ne
0
]
then
echo
"Unable to stop database server.; exiting"
1>&2
exit
1
fi
echo
"Commit fixes complete, moving data files..."
echo
"Commit fixes complete, moving data files..."
cat
"
$SCHEMA
"
|
while
read
LINE
cat
"
$SCHEMA
"
|
while
read
LINE
do
do
if
/bin/echo
"
$LINE
"
|
grep
-q
"^
\\\\
connect "
if
/bin/echo
"
$LINE
"
|
grep
-q
"^
\\\\
connect
[^ ]*$
"
then
OLDDB
=
"
$DB
"
then
OLDDB
=
"
$DB
"
DB
=
"
`
/bin/echo
\"
$LINE
\"
|
cut
-d
' '
-f2
`
"
DB
=
"
`
/bin/echo
\"
$LINE
\"
|
cut
-d
' '
-f2
`
"
if
[
"
$DB
"
=
"-"
]
if
[
"
$DB
"
=
"-"
]
...
@@ -251,19 +255,37 @@ do
...
@@ -251,19 +255,37 @@ do
fi
fi
done
done
# set max transaction id, check < 2gig
# 7.1 has non-compressed log file format
# 7.1 has non-compressed log file format
if
[
"
$SRCVERSION
"
=
"7.1"
]
if
[
"
$SRCVERSION
"
=
"7.1"
]
# pg_log is oid 1269 in 7.1
then
LOGSIZE
=
`
ls
-l
"
$OLDDIR
"
/global/1269
"
$OLDDIR
"
/global/1269.
*
2>/dev/null |
# pg_log is oid 1269 in 7.1
awk
-F
' *'
'
LOGSIZE
=
`
ls
-l
"
$OLDDIR
"
/global/1269
"
$OLDDIR
"
/global/1269.
*
2>/dev/null |
BEGIN {sum=0;}
awk
-F
' *'
'
{sum += $5;}
BEGIN {sum=0;}
END {print sum;}'
`
{sum += $5;}
END {print sum;}'
`
# check < 2gig
# set max transaction id
else
# how to handle 7.2?
rm
-r
data/pg_clog
&&
mv
"
$OLDDIR
"
/data/pg_clog data/pg_clog
&&
mv
"
$OLDDIR
"
/data/global/pg_control data/global/pg_control
if
[
"
$?
"
-ne
0
]
then
echo
"Moving of transaction and control files failed.; exiting"
1>&2
exit
1
fi
fi
pg_ctl start
if
[
"
$?
"
-ne
0
]
then
echo
"Unable to restart database server.; exiting"
1>&2
exit
1
fi
fi
echo
"You must stop/start the postmaster before doing anything else."
echo
"You may remove the
$OLDDIR
directory with 'rm -r
$OLDDIR
'."
echo
"You may remove the
$OLDDIR
directory with 'rm -r
$OLDDIR
'."
exit
0
exit
0
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