1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Fix pg_upgrade's use of pg_ctl on Win32 to not send command and sever

output to the same file, because it is impossible.

Also set user name for pg_dumpall in pg_upgrade.
This commit is contained in:
Bruce Momjian
2010-06-22 16:45:10 +00:00
parent 7b6f29006e
commit 601d1eeddc
4 changed files with 28 additions and 13 deletions

View File

@ -174,12 +174,10 @@ parseCommandLine(migratorContext *ctx, int argc, char *argv[])
* start.
*/
/* truncate */
ctx->log_fd = fopen(ctx->logfile, "w");
if (!ctx->log_fd)
if ((ctx->log_fd = fopen(ctx->logfile, "w")) == NULL)
pg_log(ctx, PG_FATAL, "Cannot write to log file %s\n", ctx->logfile);
fclose(ctx->log_fd);
ctx->log_fd = fopen(ctx->logfile, "a");
if (!ctx->log_fd)
if ((ctx->log_fd = fopen(ctx->logfile, "a")) == NULL)
pg_log(ctx, PG_FATAL, "Cannot write to log file %s\n", ctx->logfile);
}
else