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-gene...@lists.pgfoundry.org>"
Shouldn't that be changed as well?





--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to