Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit431b7b8

Browse files
committed
In pg_upgrade, fix the -l/log option to work on Windows.
Also, double-quote the log file name in all places, to allow (on allplatforms) log file names with spaces.Back patch to 9.0 and 9.1.
1 parent3089a3a commit431b7b8

File tree

1 file changed

+37
-7
lines changed

1 file changed

+37
-7
lines changed

‎contrib/pg_upgrade/pg_upgrade.c

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,14 @@ prepare_new_cluster(migratorContext *ctx)
161161
prep_status(ctx,"Analyzing all rows in the new cluster");
162162
exec_prog(ctx, true,
163163
SYSTEMQUOTE"\"%s/vacuumdb\" --port %d --username \"%s\" "
164-
"--all --analyze >> %s 2>&1"SYSTEMQUOTE,
165-
ctx->new.bindir,ctx->new.port,ctx->user,ctx->logfile);
164+
"--all --analyze >> \"%s\" 2>&1"SYSTEMQUOTE,
165+
ctx->new.bindir,ctx->new.port,ctx->user,
166+
#ifndefWIN32
167+
ctx->logfile
168+
#else
169+
DEVNULL
170+
#endif
171+
);
166172
check_ok(ctx);
167173

168174
/*
@@ -174,8 +180,14 @@ prepare_new_cluster(migratorContext *ctx)
174180
prep_status(ctx,"Freezing all rows on the new cluster");
175181
exec_prog(ctx, true,
176182
SYSTEMQUOTE"\"%s/vacuumdb\" --port %d --username \"%s\" "
177-
"--all --freeze >> %s 2>&1"SYSTEMQUOTE,
178-
ctx->new.bindir,ctx->new.port,ctx->user,ctx->logfile);
183+
"--all --freeze >> \"%s\" 2>&1"SYSTEMQUOTE,
184+
ctx->new.bindir,ctx->new.port,ctx->user,
185+
#ifndefWIN32
186+
ctx->logfile
187+
#else
188+
DEVNULL
189+
#endif
190+
);
179191
check_ok(ctx);
180192

181193
get_pg_database_relfilenode(ctx,CLUSTER_NEW);
@@ -207,7 +219,13 @@ prepare_new_databases(migratorContext *ctx)
207219
"--no-psqlrc --port %d --username \"%s\" "
208220
"-f \"%s/%s\" --dbname template1 >> \"%s\""SYSTEMQUOTE,
209221
ctx->new.bindir,ctx->new.port,ctx->user,ctx->cwd,
210-
GLOBALS_DUMP_FILE,ctx->logfile);
222+
GLOBALS_DUMP_FILE,
223+
#ifndefWIN32
224+
ctx->logfile
225+
#else
226+
DEVNULL
227+
#endif
228+
);
211229
check_ok(ctx);
212230

213231
get_db_and_rel_infos(ctx,&ctx->new.dbarr,CLUSTER_NEW);
@@ -230,7 +248,13 @@ create_new_objects(migratorContext *ctx)
230248
"--no-psqlrc --port %d --username \"%s\" "
231249
"-f \"%s/%s\" --dbname template1 >> \"%s\""SYSTEMQUOTE,
232250
ctx->new.bindir,ctx->new.port,ctx->user,ctx->cwd,
233-
DB_DUMP_FILE,ctx->logfile);
251+
DB_DUMP_FILE,
252+
#ifndefWIN32
253+
ctx->logfile
254+
#else
255+
DEVNULL
256+
#endif
257+
);
234258
check_ok(ctx);
235259

236260
/* regenerate now that we have db schemas */
@@ -282,7 +306,13 @@ copy_clog_xlog_xid(migratorContext *ctx)
282306
exec_prog(ctx, true,SYSTEMQUOTE"\"%s/pg_resetxlog\" -l %u,%u,%u \"%s\" >> \"%s\" 2>&1"SYSTEMQUOTE,
283307
ctx->new.bindir,ctx->old.controldata.chkpnt_tli,
284308
ctx->old.controldata.logid,ctx->old.controldata.nxtlogseg,
285-
ctx->new.pgdata,ctx->logfile);
309+
ctx->new.pgdata,
310+
#ifndefWIN32
311+
ctx->logfile
312+
#else
313+
DEVNULL
314+
#endif
315+
);
286316
check_ok(ctx);
287317
}
288318

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp