Skip to content

Commit 4504a1b

Browse files
committed
On Win32, pg_upgrade cannot sent any server log output to the log file
because of file access limitations on that platform.
1 parent 477c01b commit 4504a1b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

contrib/pg_upgrade/server.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* database server functions
55
*
66
* Copyright (c) 2010, PostgreSQL Global Development Group
7-
* $PostgreSQL: pgsql/contrib/pg_upgrade/server.c,v 1.8 2010/07/06 19:18:55 momjian Exp $
7+
* $PostgreSQL: pgsql/contrib/pg_upgrade/server.c,v 1.9 2010/07/13 20:03:32 momjian Exp $
88
*/
99

1010
#include "pg_upgrade.h"
@@ -181,21 +181,21 @@ start_postmaster(migratorContext *ctx, Cluster whichCluster, bool quiet)
181181
}
182182

183183
/*
184-
* On Win32, we can't send both server output and pg_ctl output to the
184+
* On Win32, we can't send both pg_upgrade output and pg_ctl output to the
185185
* same file because we get the error: "The process cannot access the file
186-
* because it is being used by another process." so we have to send pg_ctl
186+
* because it is being used by another process." so we have to send all other
187187
* output to 'nul'.
188188
*/
189189
snprintf(cmd, sizeof(cmd),
190190
SYSTEMQUOTE "\"%s/pg_ctl\" -l \"%s\" -D \"%s\" "
191191
"-o \"-p %d -c autovacuum=off "
192192
"-c autovacuum_freeze_max_age=2000000000\" "
193193
"start >> \"%s\" 2>&1" SYSTEMQUOTE,
194-
bindir, ctx->logfile, datadir, port,
194+
bindir,
195195
#ifndef WIN32
196-
ctx->logfile);
196+
ctx->logfile, datadir, port, ctx->logfile);
197197
#else
198-
DEVNULL);
198+
DEVNULL, datadir, port, DEVNULL);
199199
#endif
200200
exec_prog(ctx, true, "%s", cmd);
201201

@@ -235,11 +235,11 @@ stop_postmaster(migratorContext *ctx, bool fast, bool quiet)
235235
snprintf(cmd, sizeof(cmd),
236236
SYSTEMQUOTE "\"%s/pg_ctl\" -l \"%s\" -D \"%s\" %s stop >> "
237237
"\"%s\" 2>&1" SYSTEMQUOTE,
238-
bindir, ctx->logfile, datadir, fast ? "-m fast" : "",
238+
bindir,
239239
#ifndef WIN32
240-
ctx->logfile);
240+
ctx->logfile, datadir, fast ? "-m fast" : "", ctx->logfile);
241241
#else
242-
DEVNULL);
242+
DEVNULL, datadir, fast ? "-m fast" : "", DEVNULL);
243243
#endif
244244
exec_prog(ctx, fast ? false : true, "%s", cmd);
245245

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy