Skip to content

Instantly share code, notes, and snippets.

@benhamill
Created January 26, 2012 17:53
Show Gist options
  • Save benhamill/1684031 to your computer and use it in GitHub Desktop.
Save benhamill/1684031 to your computer and use it in GitHub Desktop.

I have followed the postgres 9.1 docs for pg_upgrade and gotten to the step of actually running the command. So I did this (note, I have -c so that it won't change anything until I am sure I want to go forward):

$ /usr/lib/postgresql/9.1/bin/pg_upgrade -c -b /usr/lib/postgresql/9.0/bin/ -B /usr/lib/postgresql/9.1/bin/ -d /vol/lib/postgresql/9.0/main -D /var/lib/postgresql/9.1/main -p 50433 -P 50432
Performing Consistency Checks
-----------------------------
Checking current, bin, and data directories                 ok
Checking cluster versions                                   ok

connection to database failed: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.50433"?


unable to connect to old postmaster started with the command: "/usr/lib/postgresql/9.0/bin/pg_ctl" -w -l "/dev/null" -D "/vol/lib/postgresql/9.0/main" -o "-p 50433 -c autovacuum=off -c autovacuum_freeze_max_age=2000000000" start >> "/dev/null" 2>&1
Failure, exiting

The docs imply that the servers should not be running, but then the command wants to connect to them, so...

$ service postgresql start * Starting PostgreSQL 9.0 database server
   ...done.
 * Starting PostgreSQL 9.1 database server
   ...done.

And then...

$ /usr/lib/postgresql/9.1/bin/pg_upgrade -c -b /usr/lib/postgresql/9.0/bin/ -B /usr/lib/postgresql/9.1/bin/ -d /vol/lib/postgresql/9.0/main -D /var/lib/postgresql/9.1/main -p 50433 -P 50432
Performing Consistency Checks on Old Live Server
------------------------------------------------
Checking current, bin, and data directories                 ok
Checking cluster versions                                   ok
Checking database user is a superuser                       ok
Checking for prepared transactions                          ok
Checking for reg* system oid user data types                ok
Checking for contrib/isn with bigint-passing mismatch       ok

pg_ctl failed to start the new server
Failure, exiting

This is really confusing... if earlier checks require that the servers be running, why would later checks try to start them? And why would they fail?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment