Re: Testing 9.0beta3 and pg_upgrade

From: Thomas Kellerer <spam_eater(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Testing 9.0beta3 and pg_upgrade
Date: 2010-07-13 13:02:15
Message-ID: i1ho4n$8d3$1@dough.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thomas Kellerer, 12.07.2010 23:29:
> Hi,
>
> I'm trying pg_upgrade on my Windows installation and I have two
> suggestions for the manual regarding pg_upgrade:
>

I found another problem and I'm not sure if this is a bug or a user error :)

My batch file to start pg_upgrade looks like this:

%~dp0server\bin\pg_upgrade ^
--check ^
--old-bindir="c:/Program Files/PostgreSQL/8.4/bin" ^
--new-bindir="c:/etc/Postgres9.0-beta3/server/bin" ^
--old-datadir="c:/Daten/db/pgdata84" ^
--new-datadir="c:/etc/Postgres9.0-beta3/datadir" ^
--user=postgres ^
--logfile=migrate.log ^
--verbose

with these settings pg_upgrade fails to start the old server.

On the console I can see:

Checking new data directory (c:/etc/Postgres9.0-beta3/datadir)ok
""c:/Program Files/PostgreSQL/8.4/bin/pg_ctl" -l "migrate.log" -D "c:/Daten/db/pgdata84" -o "-p 5432 -c autovacuum=off -c autovacuum_freeze_max_age=20
00000000" start >> "nul" 2>&1"
Trying to start old server ...........
Unable to start old postmaster with the command: ""c:/Program Files/PostgreSQL/8.4/bin/pg_ctl" -l "migrate.log" -D "c:/Daten/db/pgdata84" -o "-p 5432
-c autovacuum=off -c autovacuum_freeze_max_age=2000000000" start >> "nul" 2>&1"
Perhaps pg_hba.conf was not set to "trust".

Now when I manually copy and paste the logged command, the server starts up fine and I can verify with ProcessExplorer that pg_upgrade indeed does not spawn a postgres.exe (or pg_ctl.exe)

As I have done one successful migration already, and the only difference was the logfile, I removed the --logfile switch from the batch file and then pg_upgrade ran without problems.

In the commandline starting the old server -l "migrate.log" is replaced with -l "nul"

I _think_ the reason for this is that pg_upgrade locks migrate.log and then postgres.exe cannot write to the file and thus fails to start.
When I manually run the command, pg_upgrade is not locking migrate.log and therefor the server starts (and thus the confusion that the same command works from the commandline but not when pg_upgrade runs it)

Regards
Thomas

P.S.: pg_upgrade --help says: "Report bugs to <pg-migrator-general(at)lists(dot)pgfoundry(dot)org>"
Shouldn't that be changed as well?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andras Fabian 2010-07-13 14:16:23 Re: PG_DUMP very slow because of STDOUT ??
Previous Message Atul.Goel 2010-07-13 12:54:54 Writing XML files to Operating System