Thomas Kellerer wrote:
> Hi,
>
> I'm trying pg_upgrade on my Windows installation and I have two
> suggestions for the manual regarding pg_upgrade:
>
> When specifying directories, pg_upgrade *requires* a forward slash as
> the path separator. This is (still) uncommon in the Windows world
> (although Windows does support it) and even though the example in the
> manual does show forward slashes, I think it would be a good idea to
> specifically mention the fact that it will *not* work with a backslash.
Are you sure this is not the behavior of all Postgres commands? For
example, if you use 'psql -f filename dbname', does 'filename' have the
same behavior as the pg_upgrade directory specifications?
> The "cannot run inside a transaction block" rang a bell, and once I
> removed "\set AUTOCOMMIT off" from my psqlrc.conf, pg_upgrade went
> through without problems.
>
> I would suggest to either manually change the autocommit mode from
> within pg_upgrade or to add a note in the manual to disable/remove this
> setting from psqlrc.conf before running pg_upgrade. Personally I think
> the first option would be the better one.
I have applied the attached patch so .psqlrc is no longer read by psql.
That should fix this problem. I can't imagine anything pg_upgrade needs
in .pgsqlrc.
--
Bruce Momjian <[email protected]> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ None of us is going to be here forever. +
Index: contrib/pg_upgrade/check.c
===================================================================
RCS file: /cvsroot/pgsql/contrib/pg_upgrade/check.c,v
retrieving revision 1.11
diff -c -c -r1.11 check.c
*** contrib/pg_upgrade/check.c 6 Jul 2010 19:18:55 -0000 1.11
--- contrib/pg_upgrade/check.c 13 Jul 2010 15:56:43 -0000
***************
*** 152,160 ****
{
prep_status(ctx, "Adjusting sequences");
exec_prog(ctx, true,
! SYSTEMQUOTE "\"%s/psql\" --set ON_ERROR_STOP=on --port %d "
! "--username \"%s\" -f \"%s\" --dbname template1 >> \"%s\""
! SYSTEMQUOTE,
ctx->new.bindir, ctx->new.port, ctx->user,
sequence_script_file_name, ctx->logfile);
unlink(sequence_script_file_name);
--- 152,160 ----
{
prep_status(ctx, "Adjusting sequences");
exec_prog(ctx, true,
! SYSTEMQUOTE "\"%s/psql\" --set ON_ERROR_STOP=on "
! "--no-psqlrc --port %d --username \"%s\" "
! "-f \"%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
ctx->new.bindir, ctx->new.port, ctx->user,
sequence_script_file_name, ctx->logfile);
unlink(sequence_script_file_name);
Index: contrib/pg_upgrade/pg_upgrade.c
===================================================================
RCS file: /cvsroot/pgsql/contrib/pg_upgrade/pg_upgrade.c,v
retrieving revision 1.10
diff -c -c -r1.10 pg_upgrade.c
*** contrib/pg_upgrade/pg_upgrade.c 6 Jul 2010 19:18:55 -0000 1.10
--- contrib/pg_upgrade/pg_upgrade.c 13 Jul 2010 15:56:43 -0000
***************
*** 202,210 ****
*/
prep_status(ctx, "Creating databases in the new cluster");
exec_prog(ctx, true,
! SYSTEMQUOTE "\"%s/psql\" --port %d --username \"%s\" "
! "--set ON_ERROR_STOP=on -f \"%s/%s\" --dbname template1 >> \"%s\""
! SYSTEMQUOTE,
ctx->new.bindir, ctx->new.port, ctx->user, ctx->cwd,
GLOBALS_DUMP_FILE, ctx->logfile);
check_ok(ctx);
--- 202,211 ----
*/
prep_status(ctx, "Creating databases in the new cluster");
exec_prog(ctx, true,
! SYSTEMQUOTE "\"%s/psql\" --set ON_ERROR_STOP=on "
! /* --no-psqlrc prevents AUTOCOMMIT=off */
! "--no-psqlrc --port %d --username \"%s\" "
! "-f \"%s/%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
ctx->new.bindir, ctx->new.port, ctx->user, ctx->cwd,
GLOBALS_DUMP_FILE, ctx->logfile);
check_ok(ctx);
***************
*** 225,233 ****
prep_status(ctx, "Restoring database schema to new cluster");
exec_prog(ctx, true,
! SYSTEMQUOTE "\"%s/psql\" --port %d --username \"%s\" "
! "--set ON_ERROR_STOP=on -f \"%s/%s\" --dbname template1 >> \"%s\""
! SYSTEMQUOTE,
ctx->new.bindir, ctx->new.port, ctx->user, ctx->cwd,
DB_DUMP_FILE, ctx->logfile);
check_ok(ctx);
--- 226,234 ----
prep_status(ctx, "Restoring database schema to new cluster");
exec_prog(ctx, true,
! SYSTEMQUOTE "\"%s/psql\" --set ON_ERROR_STOP=on "
! "--no-psqlrc --port %d --username \"%s\" "
! "-f \"%s/%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE,
ctx->new.bindir, ctx->new.port, ctx->user, ctx->cwd,
DB_DUMP_FILE, ctx->logfile);
check_ok(ctx);
--
Sent via pgsql-general mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general