Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id AF182632D87; Wed, 23 Jun 2010 17:04:37 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 82530-10; Wed, 23 Jun 2010 20:04:29 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id CAC5E632416; Wed, 23 Jun 2010 17:04:29 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id o5NK4MA15973; Wed, 23 Jun 2010 16:04:22 -0400 (EDT) From: Bruce Momjian Message-Id: <201006232004.o5NK4MA15973@momjian.us> Subject: Re: [TESTERS] R: Postgresql 9.0b2 : pg_upgrade not passing username to pgdumpall ? In-Reply-To: To: "Cassiano, Marco" Date: Wed, 23 Jun 2010 16:04:22 -0400 (EDT) CC: pgsql-admin@postgresql.org, pgsql-testers@postgresql.org X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ELM1277323461-740-1_" Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.51 tagged_above=-10 required=5 tests=BAYES_05=-0.5, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201006/193 X-Sequence-Number: 34971 --ELM1277323461-740-1_ Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" Cassiano, Marco wrote: > Thank you Bruce, > > I applied the patch and found two things you might want to take in consideration : > > 1) dump.c Line 25 should be : > > SYSTEMQUOTE, ctx->new.bindir, ctx->old.port, ctx->user, ctx->output_dir); > > And not > > SYSTEMQUOTE, ctx->new.bindir, ctx->old.port, ctx->user, ctx->cwd); > > (sorry, I'm not confident at producing patch files....) OK, the problem here is that I changed output_dir to cwd since beta2; your change is fine for your version of pg_upgrade. > 2) I then recompiled pg_upgrade and reinstalled it. Now it goes > a little bit further but I think there's another point (vacuumdb of > the new cluster) in which the username is missing. You might want >to take a look at this output (/tmp/pg_upgrade.log) Ah, you are right --- I seem to have missed a bunch of username designations. I went through and looked all all the exec calls, and added the username to each one that supported it; applied patch attached. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + None of us is going to be here forever. + --ELM1277323461-740-1_ Content-Transfer-Encoding: 7bit Content-Type: text/x-diff Content-Disposition: inline; filename="/rtmp/diff" Index: contrib/pg_upgrade/check.c =================================================================== RCS file: /cvsroot/pgsql/contrib/pg_upgrade/check.c,v retrieving revision 1.6 diff -c -c -r1.6 check.c *** contrib/pg_upgrade/check.c 12 Jun 2010 17:05:29 -0000 1.6 --- contrib/pg_upgrade/check.c 23 Jun 2010 20:03:07 -0000 *************** *** 149,158 **** { prep_status(ctx, "Adjusting sequences"); exec_prog(ctx, true, ! SYSTEMQUOTE "\"%s/psql\" --set ON_ERROR_STOP=on --port %d " ! "-f \"%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE, ! ctx->new.bindir, ctx->new.port, sequence_script_file_name, ! ctx->logfile); unlink(sequence_script_file_name); check_ok(ctx); } --- 149,159 ---- { 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); check_ok(ctx); } Index: contrib/pg_upgrade/pg_upgrade.c =================================================================== RCS file: /cvsroot/pgsql/contrib/pg_upgrade/pg_upgrade.c,v retrieving revision 1.5 diff -c -c -r1.5 pg_upgrade.c *** contrib/pg_upgrade/pg_upgrade.c 12 Jun 2010 17:05:29 -0000 1.5 --- contrib/pg_upgrade/pg_upgrade.c 23 Jun 2010 20:03:07 -0000 *************** *** 78,84 **** * because there is no need to have the schema load use new oids. */ prep_status(&ctx, "Setting next oid for new cluster"); ! exec_prog(&ctx, true, SYSTEMQUOTE "\"%s/pg_resetxlog\" -o %u \"%s\" > " DEVNULL SYSTEMQUOTE, ctx.new.bindir, ctx.old.controldata.chkpnt_nxtoid, ctx.new.pgdata); check_ok(&ctx); --- 78,85 ---- * because there is no need to have the schema load use new oids. */ prep_status(&ctx, "Setting next oid for new cluster"); ! exec_prog(&ctx, true, SYSTEMQUOTE "\"%s/pg_resetxlog\" -o %u \"%s\" > " ! DEVNULL SYSTEMQUOTE, ctx.new.bindir, ctx.old.controldata.chkpnt_nxtoid, ctx.new.pgdata); check_ok(&ctx); *************** *** 156,163 **** */ prep_status(ctx, "Analyzing all rows in the new cluster"); exec_prog(ctx, true, ! SYSTEMQUOTE "\"%s/vacuumdb\" --port %d --all --analyze >> %s 2>&1" SYSTEMQUOTE, ! ctx->new.bindir, ctx->new.port, ctx->logfile); check_ok(ctx); /* --- 157,165 ---- */ prep_status(ctx, "Analyzing all rows in the new cluster"); exec_prog(ctx, true, ! SYSTEMQUOTE "\"%s/vacuumdb\" --port %d --username \"%s\" " ! "--all --analyze >> %s 2>&1" SYSTEMQUOTE, ! ctx->new.bindir, ctx->new.port, ctx->user, ctx->logfile); check_ok(ctx); /* *************** *** 168,175 **** */ prep_status(ctx, "Freezing all rows on the new cluster"); exec_prog(ctx, true, ! SYSTEMQUOTE "\"%s/vacuumdb\" --port %d --all --freeze >> %s 2>&1" SYSTEMQUOTE, ! ctx->new.bindir, ctx->new.port, ctx->logfile); check_ok(ctx); get_pg_database_relfilenode(ctx, CLUSTER_NEW); --- 170,178 ---- */ prep_status(ctx, "Freezing all rows on the new cluster"); exec_prog(ctx, true, ! SYSTEMQUOTE "\"%s/vacuumdb\" --port %d --username \"%s\" " ! "--all --freeze >> %s 2>&1" SYSTEMQUOTE, ! ctx->new.bindir, ctx->new.port, ctx->user, ctx->logfile); check_ok(ctx); get_pg_database_relfilenode(ctx, CLUSTER_NEW); *************** *** 196,204 **** */ prep_status(ctx, "Creating databases in the new cluster"); exec_prog(ctx, true, ! SYSTEMQUOTE "\"%s/psql\" --set ON_ERROR_STOP=on --port %d " ! "-f \"%s/%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE, ! ctx->new.bindir, ctx->new.port, ctx->cwd, GLOBALS_DUMP_FILE, ctx->logfile); check_ok(ctx); --- 199,208 ---- */ 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); *************** *** 218,226 **** prep_status(ctx, "Restoring database schema to new cluster"); exec_prog(ctx, true, ! SYSTEMQUOTE "\"%s/psql\" --set ON_ERROR_STOP=on --port %d " ! "-f \"%s/%s\" --dbname template1 >> \"%s\"" SYSTEMQUOTE, ! ctx->new.bindir, ctx->new.port, ctx->cwd, DB_DUMP_FILE, ctx->logfile); check_ok(ctx); --- 222,231 ---- 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); Index: contrib/pg_upgrade/server.c =================================================================== RCS file: /cvsroot/pgsql/contrib/pg_upgrade/server.c,v retrieving revision 1.3 diff -c -c -r1.3 server.c *** contrib/pg_upgrade/server.c 22 Jun 2010 16:45:10 -0000 1.3 --- contrib/pg_upgrade/server.c 23 Jun 2010 20:03:07 -0000 *************** *** 185,191 **** */ snprintf(cmd, sizeof(cmd), SYSTEMQUOTE "\"%s/pg_ctl\" -l \"%s\" -D \"%s\" " ! "-o \"-p %d -c autovacuum=off -c autovacuum_freeze_max_age=2000000000\" " "start >> \"%s\" 2>&1" SYSTEMQUOTE, bindir, ctx->logfile, datadir, port, #ifndef WIN32 --- 185,192 ---- */ snprintf(cmd, sizeof(cmd), SYSTEMQUOTE "\"%s/pg_ctl\" -l \"%s\" -D \"%s\" " ! "-o \"-p %d -c autovacuum=off " ! "-c autovacuum_freeze_max_age=2000000000\" " "start >> \"%s\" 2>&1" SYSTEMQUOTE, bindir, ctx->logfile, datadir, port, #ifndef WIN32 *************** *** 229,235 **** /* See comment in start_postmaster() about why win32 output is ignored. */ snprintf(cmd, sizeof(cmd), ! SYSTEMQUOTE "\"%s/pg_ctl\" -l \"%s\" -D \"%s\" %s stop >> \"%s\" 2>&1" SYSTEMQUOTE, bindir, ctx->logfile, datadir, fast ? "-m fast" : "", #ifndef WIN32 ctx->logfile); --- 230,237 ---- /* See comment in start_postmaster() about why win32 output is ignored. */ snprintf(cmd, sizeof(cmd), ! SYSTEMQUOTE "\"%s/pg_ctl\" -l \"%s\" -D \"%s\" %s stop >> " ! "\"%s\" 2>&1" SYSTEMQUOTE, bindir, ctx->logfile, datadir, fast ? "-m fast" : "", #ifndef WIN32 ctx->logfile); --ELM1277323461-740-1_--