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
c1b61798
Commit
c1b61798
authored
14 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Add username designations to all pg_upgrade utility calls that support it.
parent
601d1eed
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
contrib/pg_upgrade/check.c
+5
-4
5 additions, 4 deletions
contrib/pg_upgrade/check.c
contrib/pg_upgrade/pg_upgrade.c
+16
-11
16 additions, 11 deletions
contrib/pg_upgrade/pg_upgrade.c
contrib/pg_upgrade/server.c
+4
-2
4 additions, 2 deletions
contrib/pg_upgrade/server.c
with
25 additions
and
17 deletions
contrib/pg_upgrade/check.c
+
5
−
4
View file @
c1b61798
...
@@ -149,10 +149,11 @@ issue_warnings(migratorContext *ctx, char *sequence_script_file_name)
...
@@ -149,10 +149,11 @@ issue_warnings(migratorContext *ctx, char *sequence_script_file_name)
{
{
prep_status
(
ctx
,
"Adjusting sequences"
);
prep_status
(
ctx
,
"Adjusting sequences"
);
exec_prog
(
ctx
,
true
,
exec_prog
(
ctx
,
true
,
SYSTEMQUOTE
"
\"
%s/psql
\"
--set ON_ERROR_STOP=on --port %d "
SYSTEMQUOTE
"
\"
%s/psql
\"
--set ON_ERROR_STOP=on --port %d "
"-f
\"
%s
\"
--dbname template1 >>
\"
%s
\"
"
SYSTEMQUOTE
,
"--username
\"
%s
\"
-f
\"
%s
\"
--dbname template1 >>
\"
%s
\"
"
ctx
->
new
.
bindir
,
ctx
->
new
.
port
,
sequence_script_file_name
,
SYSTEMQUOTE
,
ctx
->
logfile
);
ctx
->
new
.
bindir
,
ctx
->
new
.
port
,
ctx
->
user
,
sequence_script_file_name
,
ctx
->
logfile
);
unlink
(
sequence_script_file_name
);
unlink
(
sequence_script_file_name
);
check_ok
(
ctx
);
check_ok
(
ctx
);
}
}
...
...
This diff is collapsed.
Click to expand it.
contrib/pg_upgrade/pg_upgrade.c
+
16
−
11
View file @
c1b61798
...
@@ -78,7 +78,8 @@ main(int argc, char **argv)
...
@@ -78,7 +78,8 @@ main(int argc, char **argv)
* because there is no need to have the schema load use new oids.
* because there is no need to have the schema load use new oids.
*/
*/
prep_status
(
&
ctx
,
"Setting next oid for new cluster"
);
prep_status
(
&
ctx
,
"Setting next oid for new cluster"
);
exec_prog
(
&
ctx
,
true
,
SYSTEMQUOTE
"
\"
%s/pg_resetxlog
\"
-o %u
\"
%s
\"
> "
DEVNULL
SYSTEMQUOTE
,
exec_prog
(
&
ctx
,
true
,
SYSTEMQUOTE
"
\"
%s/pg_resetxlog
\"
-o %u
\"
%s
\"
> "
DEVNULL
SYSTEMQUOTE
,
ctx
.
new
.
bindir
,
ctx
.
old
.
controldata
.
chkpnt_nxtoid
,
ctx
.
new
.
pgdata
);
ctx
.
new
.
bindir
,
ctx
.
old
.
controldata
.
chkpnt_nxtoid
,
ctx
.
new
.
pgdata
);
check_ok
(
&
ctx
);
check_ok
(
&
ctx
);
...
@@ -156,8 +157,9 @@ prepare_new_cluster(migratorContext *ctx)
...
@@ -156,8 +157,9 @@ prepare_new_cluster(migratorContext *ctx)
*/
*/
prep_status
(
ctx
,
"Analyzing all rows in the new cluster"
);
prep_status
(
ctx
,
"Analyzing all rows in the new cluster"
);
exec_prog
(
ctx
,
true
,
exec_prog
(
ctx
,
true
,
SYSTEMQUOTE
"
\"
%s/vacuumdb
\"
--port %d --all --analyze >> %s 2>&1"
SYSTEMQUOTE
,
SYSTEMQUOTE
"
\"
%s/vacuumdb
\"
--port %d --username
\"
%s
\"
"
ctx
->
new
.
bindir
,
ctx
->
new
.
port
,
ctx
->
logfile
);
"--all --analyze >> %s 2>&1"
SYSTEMQUOTE
,
ctx
->
new
.
bindir
,
ctx
->
new
.
port
,
ctx
->
user
,
ctx
->
logfile
);
check_ok
(
ctx
);
check_ok
(
ctx
);
/*
/*
...
@@ -168,8 +170,9 @@ prepare_new_cluster(migratorContext *ctx)
...
@@ -168,8 +170,9 @@ prepare_new_cluster(migratorContext *ctx)
*/
*/
prep_status
(
ctx
,
"Freezing all rows on the new cluster"
);
prep_status
(
ctx
,
"Freezing all rows on the new cluster"
);
exec_prog
(
ctx
,
true
,
exec_prog
(
ctx
,
true
,
SYSTEMQUOTE
"
\"
%s/vacuumdb
\"
--port %d --all --freeze >> %s 2>&1"
SYSTEMQUOTE
,
SYSTEMQUOTE
"
\"
%s/vacuumdb
\"
--port %d --username
\"
%s
\"
"
ctx
->
new
.
bindir
,
ctx
->
new
.
port
,
ctx
->
logfile
);
"--all --freeze >> %s 2>&1"
SYSTEMQUOTE
,
ctx
->
new
.
bindir
,
ctx
->
new
.
port
,
ctx
->
user
,
ctx
->
logfile
);
check_ok
(
ctx
);
check_ok
(
ctx
);
get_pg_database_relfilenode
(
ctx
,
CLUSTER_NEW
);
get_pg_database_relfilenode
(
ctx
,
CLUSTER_NEW
);
...
@@ -196,9 +199,10 @@ prepare_new_databases(migratorContext *ctx)
...
@@ -196,9 +199,10 @@ prepare_new_databases(migratorContext *ctx)
*/
*/
prep_status
(
ctx
,
"Creating databases in the new cluster"
);
prep_status
(
ctx
,
"Creating databases in the new cluster"
);
exec_prog
(
ctx
,
true
,
exec_prog
(
ctx
,
true
,
SYSTEMQUOTE
"
\"
%s/psql
\"
--set ON_ERROR_STOP=on --port %d "
SYSTEMQUOTE
"
\"
%s/psql
\"
--port %d --username
\"
%s
\"
"
"-f
\"
%s/%s
\"
--dbname template1 >>
\"
%s
\"
"
SYSTEMQUOTE
,
"--set ON_ERROR_STOP=on -f
\"
%s/%s
\"
--dbname template1 >>
\"
%s
\"
"
ctx
->
new
.
bindir
,
ctx
->
new
.
port
,
ctx
->
cwd
,
SYSTEMQUOTE
,
ctx
->
new
.
bindir
,
ctx
->
new
.
port
,
ctx
->
user
,
ctx
->
cwd
,
GLOBALS_DUMP_FILE
,
ctx
->
logfile
);
GLOBALS_DUMP_FILE
,
ctx
->
logfile
);
check_ok
(
ctx
);
check_ok
(
ctx
);
...
@@ -218,9 +222,10 @@ create_new_objects(migratorContext *ctx)
...
@@ -218,9 +222,10 @@ create_new_objects(migratorContext *ctx)
prep_status
(
ctx
,
"Restoring database schema to new cluster"
);
prep_status
(
ctx
,
"Restoring database schema to new cluster"
);
exec_prog
(
ctx
,
true
,
exec_prog
(
ctx
,
true
,
SYSTEMQUOTE
"
\"
%s/psql
\"
--set ON_ERROR_STOP=on --port %d "
SYSTEMQUOTE
"
\"
%s/psql
\"
--port %d --username
\"
%s
\"
"
"-f
\"
%s/%s
\"
--dbname template1 >>
\"
%s
\"
"
SYSTEMQUOTE
,
"--set ON_ERROR_STOP=on -f
\"
%s/%s
\"
--dbname template1 >>
\"
%s
\"
"
ctx
->
new
.
bindir
,
ctx
->
new
.
port
,
ctx
->
cwd
,
SYSTEMQUOTE
,
ctx
->
new
.
bindir
,
ctx
->
new
.
port
,
ctx
->
user
,
ctx
->
cwd
,
DB_DUMP_FILE
,
ctx
->
logfile
);
DB_DUMP_FILE
,
ctx
->
logfile
);
check_ok
(
ctx
);
check_ok
(
ctx
);
...
...
This diff is collapsed.
Click to expand it.
contrib/pg_upgrade/server.c
+
4
−
2
View file @
c1b61798
...
@@ -185,7 +185,8 @@ start_postmaster(migratorContext *ctx, Cluster whichCluster, bool quiet)
...
@@ -185,7 +185,8 @@ start_postmaster(migratorContext *ctx, Cluster whichCluster, bool quiet)
*/
*/
snprintf
(
cmd
,
sizeof
(
cmd
),
snprintf
(
cmd
,
sizeof
(
cmd
),
SYSTEMQUOTE
"
\"
%s/pg_ctl
\"
-l
\"
%s
\"
-D
\"
%s
\"
"
SYSTEMQUOTE
"
\"
%s/pg_ctl
\"
-l
\"
%s
\"
-D
\"
%s
\"
"
"-o
\"
-p %d -c autovacuum=off -c autovacuum_freeze_max_age=2000000000
\"
"
"-o
\"
-p %d -c autovacuum=off "
"-c autovacuum_freeze_max_age=2000000000
\"
"
"start >>
\"
%s
\"
2>&1"
SYSTEMQUOTE
,
"start >>
\"
%s
\"
2>&1"
SYSTEMQUOTE
,
bindir
,
ctx
->
logfile
,
datadir
,
port
,
bindir
,
ctx
->
logfile
,
datadir
,
port
,
#ifndef WIN32
#ifndef WIN32
...
@@ -229,7 +230,8 @@ stop_postmaster(migratorContext *ctx, bool fast, bool quiet)
...
@@ -229,7 +230,8 @@ stop_postmaster(migratorContext *ctx, bool fast, bool quiet)
/* See comment in start_postmaster() about why win32 output is ignored. */
/* See comment in start_postmaster() about why win32 output is ignored. */
snprintf
(
cmd
,
sizeof
(
cmd
),
snprintf
(
cmd
,
sizeof
(
cmd
),
SYSTEMQUOTE
"
\"
%s/pg_ctl
\"
-l
\"
%s
\"
-D
\"
%s
\"
%s stop >>
\"
%s
\"
2>&1"
SYSTEMQUOTE
,
SYSTEMQUOTE
"
\"
%s/pg_ctl
\"
-l
\"
%s
\"
-D
\"
%s
\"
%s stop >> "
"
\"
%s
\"
2>&1"
SYSTEMQUOTE
,
bindir
,
ctx
->
logfile
,
datadir
,
fast
?
"-m fast"
:
""
,
bindir
,
ctx
->
logfile
,
datadir
,
fast
?
"-m fast"
:
""
,
#ifndef WIN32
#ifndef WIN32
ctx
->
logfile
);
ctx
->
logfile
);
...
...
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