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
37c9346e
Commit
37c9346e
authored
23 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
pg_resetxlog specifies log location in hex; more pg_upgrade testing
improvments.
parent
ba3231a2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
contrib/pg_resetxlog/pg_resetxlog.c
+4
-4
4 additions, 4 deletions
contrib/pg_resetxlog/pg_resetxlog.c
src/bin/pg_dump/pg_upgrade
+11
-8
11 additions, 8 deletions
src/bin/pg_dump/pg_upgrade
with
15 additions
and
12 deletions
contrib/pg_resetxlog/pg_resetxlog.c
+
4
−
4
View file @
37c9346e
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* $Header: /cvsroot/pgsql/contrib/pg_resetxlog/Attic/pg_resetxlog.c,v 1.1
5
2002/01/1
0 23:46:13
momjian Exp $
* $Header: /cvsroot/pgsql/contrib/pg_resetxlog/Attic/pg_resetxlog.c,v 1.1
6
2002/01/1
1 06:33:01
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -482,7 +482,7 @@ usage(void)
...
@@ -482,7 +482,7 @@ usage(void)
" -f
\t
force update to be done
\n
"
" -f
\t
force update to be done
\n
"
" -n
\t
no update, just show extracted pg_control values (for testing)
\n
"
" -n
\t
no update, just show extracted pg_control values (for testing)
\n
"
" -x XID set XID in pg_control
\n
"
" -x XID set XID in pg_control
\n
"
" -l log_id offset set checkpoint location in pg_control
\n
"
);
" -l log_id offset set
hex
checkpoint location in pg_control
\n
"
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -523,11 +523,11 @@ main(int argc, char **argv)
...
@@ -523,11 +523,11 @@ main(int argc, char **argv)
argn
++
;
argn
++
;
if
(
argn
==
argc
)
if
(
argn
==
argc
)
usage
();
usage
();
set_checkpoint
.
xlogid
=
strtoul
(
argv
[
argn
],
NULL
,
0
);
set_checkpoint
.
xlogid
=
strtoul
(
argv
[
argn
],
NULL
,
16
);
argn
++
;
argn
++
;
if
(
argn
==
argc
)
if
(
argn
==
argc
)
usage
();
usage
();
set_checkpoint
.
xrecoff
=
strtoul
(
argv
[
argn
],
NULL
,
0
);
set_checkpoint
.
xrecoff
=
strtoul
(
argv
[
argn
],
NULL
,
16
);
if
(
set_checkpoint
.
xlogid
==
0
&&
if
(
set_checkpoint
.
xlogid
==
0
&&
set_checkpoint
.
xrecoff
==
0
)
set_checkpoint
.
xrecoff
==
0
)
{
{
...
...
This diff is collapsed.
Click to expand it.
src/bin/pg_dump/pg_upgrade
+
11
−
8
View file @
37c9346e
...
@@ -3,7 +3,9 @@
...
@@ -3,7 +3,9 @@
# 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.26 2002/01/11 06:08:02 momjian Exp $
#set -x
# $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_upgrade,v 1.27 2002/01/11 06:33:01 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.
...
@@ -106,7 +108,7 @@ Install it from pgsql/contrib/pg_resetxlog and continue.; exiting" 1>&2
...
@@ -106,7 +108,7 @@ Install it from pgsql/contrib/pg_resetxlog and continue.; exiting" 1>&2
exit
1
exit
1
fi
fi
if
!
pg_resetxlog
-x
|
grep
-q
XID
if
!
pg_resetxlog
-x
2>&1
|
grep
-q
XID
then
echo
"Old version of pg_resetxlog found in path.
then
echo
"Old version of pg_resetxlog found in path.
Install a newer version from pgsql/contrib/pg_resetxlog.; exiting"
1>&2
Install a newer version from pgsql/contrib/pg_resetxlog.; exiting"
1>&2
exit
1
exit
1
...
@@ -261,7 +263,7 @@ fi
...
@@ -261,7 +263,7 @@ fi
# Set checkpoint location of new database
# Set checkpoint location of new database
pg_resetxlog
-l
`
echo
"
$CHKPOINT
| tr '/' ' '
`
data
pg_resetxlog
-l
`
echo
"
$CHKPOINT
"
|
tr
'/'
' '
`
data
if
[
"
$?
"
-ne
0
]
if
[
"
$?
"
-ne
0
]
then
echo
"Unable to set new checkpoint location.; exiting"
1>&2
then
echo
"Unable to set new checkpoint location.; exiting"
1>&2
exit
1
exit
1
...
@@ -278,7 +280,7 @@ fi
...
@@ -278,7 +280,7 @@ fi
# Set sequence values for 7.1-version sequences, which were int4.
# Set sequence values for 7.1-version sequences, which were int4.
if
[
"
$SRC_VERSION
"
=
"7.1"
]
if
[
"
$SRC_VERSION
"
=
"7.1"
]
else
echo
"Set int8 sequence values from 7.1..."
then
echo
"Set int8 sequence values from 7.1..."
psql
-d
template1
-At
-c
"SELECT datname FROM pg_database"
|
psql
-d
template1
-At
-c
"SELECT datname FROM pg_database"
|
while
read
DB
while
read
DB
...
@@ -355,10 +357,11 @@ SET relkind = 'S'
...
@@ -355,10 +357,11 @@ SET relkind = 'S'
WHERE relname = '
$SEQUENCE
';
WHERE relname = '
$SEQUENCE
';
SQL_END
SQL_END
if
[
$?
-ne
0
]
if
[
$?
-ne
0
]
then
echo
"There were errors during int4 sequence restore.
then
echo
"There were errors during int4 sequence restore.
$0
aborted."
1>&2
$0
aborted."
1>&2
exit
1
exit
1
fi
done
done
done
done
fi
fi
...
...
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