Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
4d151d0b
Commit
4d151d0b
authored
Jan 10, 2002
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More improvements; still disabled. (Don't panic.)
parent
92a2598f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
12 deletions
+34
-12
src/bin/pg_dump/pg_upgrade
src/bin/pg_dump/pg_upgrade
+34
-12
No files found.
src/bin/pg_dump/pg_upgrade
View file @
4d151d0b
...
...
@@ -3,7 +3,7 @@
# pg_upgrade: update a database without needing a full dump/reload cycle.
# 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
# below for each new PostgreSQL release.
...
...
@@ -164,7 +164,7 @@ fi
# Now vacuum each result database in case our transaction increase
# 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
echo
"VACUUM;"
| psql
"
$DB
"
if
[
$?
-ne
0
]
...
...
@@ -179,12 +179,16 @@ pg_dumpall -s > $TMPFILE 2>/dev/null
# flush buffers to disk
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..."
cat
"
$SCHEMA
"
|
while
read
LINE
do
if
/bin/echo
"
$LINE
"
|
grep
-q
"^
\\\\
connect "
if
/bin/echo
"
$LINE
"
|
grep
-q
"^
\\\\
connect
[^ ]*$
"
then
OLDDB
=
"
$DB
"
DB
=
"
`
/bin/echo
\"
$LINE
\"
|
cut
-d
' '
-f2
`
"
if
[
"
$DB
"
=
"-"
]
...
...
@@ -251,19 +255,37 @@ do
fi
done
# set max transaction id, check < 2gig
# 7.1 has non-compressed log file format
if
[
"
$SRCVERSION
"
=
"7.1"
]
# pg_log is oid 1269 in 7.1
LOGSIZE
=
`
ls
-l
"
$OLDDIR
"
/global/1269
"
$OLDDIR
"
/global/1269.
*
2>/dev/null |
awk
-F
' *'
'
BEGIN {sum=0;}
{sum += $5;}
END {print sum;}'
`
then
# pg_log is oid 1269 in 7.1
LOGSIZE
=
`
ls
-l
"
$OLDDIR
"
/global/1269
"
$OLDDIR
"
/global/1269.
*
2>/dev/null |
awk
-F
' *'
'
BEGIN {sum=0;}
{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
echo
"You must stop/start the postmaster before doing anything else."
echo
"You may remove the
$OLDDIR
directory with 'rm -r
$OLDDIR
'."
exit
0
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment