Commit 804f96ac authored by Bruce Momjian's avatar Bruce Momjian

In pg_upgrade, prevent psql AUTOCOMMIT=off by not loading .psqlrc.

parent 2751a249
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* server checks and output routines * server checks and output routines
* *
* Copyright (c) 2010, PostgreSQL Global Development Group * Copyright (c) 2010, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/contrib/pg_upgrade/check.c,v 1.11 2010/07/06 19:18:55 momjian Exp $ * $PostgreSQL: pgsql/contrib/pg_upgrade/check.c,v 1.12 2010/07/13 15:56:53 momjian Exp $
*/ */
#include "pg_upgrade.h" #include "pg_upgrade.h"
...@@ -152,9 +152,9 @@ issue_warnings(migratorContext *ctx, char *sequence_script_file_name) ...@@ -152,9 +152,9 @@ 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 "
"--username \"%s\" -f \"%s\" --dbname template1 >> \"%s\"" "--no-psqlrc --port %d --username \"%s\" "
SYSTEMQUOTE, "-f \"%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
ctx->new.bindir, ctx->new.port, ctx->user, ctx->new.bindir, ctx->new.port, ctx->user,
sequence_script_file_name, ctx->logfile); sequence_script_file_name, ctx->logfile);
unlink(sequence_script_file_name); unlink(sequence_script_file_name);
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* main source file * main source file
* *
* Copyright (c) 2010, PostgreSQL Global Development Group * Copyright (c) 2010, PostgreSQL Global Development Group
* $PostgreSQL: pgsql/contrib/pg_upgrade/pg_upgrade.c,v 1.10 2010/07/06 19:18:55 momjian Exp $ * $PostgreSQL: pgsql/contrib/pg_upgrade/pg_upgrade.c,v 1.11 2010/07/13 15:56:53 momjian Exp $
*/ */
#include "pg_upgrade.h" #include "pg_upgrade.h"
...@@ -202,9 +202,10 @@ prepare_new_databases(migratorContext *ctx) ...@@ -202,9 +202,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\" --port %d --username \"%s\" " SYSTEMQUOTE "\"%s/psql\" --set ON_ERROR_STOP=on "
"--set ON_ERROR_STOP=on -f \"%s/%s\" --dbname template1 >> \"%s\"" /* --no-psqlrc prevents AUTOCOMMIT=off */
SYSTEMQUOTE, "--no-psqlrc --port %d --username \"%s\" "
"-f \"%s/%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
ctx->new.bindir, ctx->new.port, ctx->user, ctx->cwd, 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);
...@@ -225,9 +226,9 @@ create_new_objects(migratorContext *ctx) ...@@ -225,9 +226,9 @@ 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\" --port %d --username \"%s\" " SYSTEMQUOTE "\"%s/psql\" --set ON_ERROR_STOP=on "
"--set ON_ERROR_STOP=on -f \"%s/%s\" --dbname template1 >> \"%s\"" "--no-psqlrc --port %d --username \"%s\" "
SYSTEMQUOTE, "-f \"%s/%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
ctx->new.bindir, ctx->new.port, ctx->user, ctx->cwd, 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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment