pg_upgrade version check improvements and small fixes - Mailing list pgsql-hackers

From Dan McGee
Subject pg_upgrade version check improvements and small fixes
Date
Msg-id BANLkTikcXXDFL0MZwwHSii1bC6zMomGDvg@mail.gmail.com
Whole thread Raw
Responses Re: pg_upgrade version check improvements and small fixes
List pgsql-hackers
Not sure what the normal process is for patches, but I put together a
few small patches for pg_upgrade after trying to use it earlier today
and staring a non-helpful error message before I finally figured out
what was going on.

0001 is just a simple typo fix, but didn't want to mix it in with the rest.
0002 moves a function around to be declared in the only place it is
needed, and prevents a "sh: /oasdfpt/pgsql-8.4/bin/pg_config: No such
file or directory" error message when you give it a bogus bindir.

0003 is what I really wanted to solve, which was my failure with
pg_upgrade. The call to pg_ctl didn't succeed because the binaries
didn't match the data directory, thus resulting in this:

$ pg_upgrade --check -d /tmp/olddata -D /tmp/newdata -b /usr/bin/ -B /usr/bin/
Performing Consistency Checks
-----------------------------
Checking old data directory (/tmp/olddata)                  ok
Checking old bin directory (/usr/bin)                       ok
Checking new data directory (/tmp/newdata)                  ok
Checking new bin directory (/usr/bin)                       ok
pg_resetxlog: pg_control exists but is broken or unknown version; ignoring it
Trying to start old server                                  .................ok

 Unable to start old postmaster with the command: "/usr/bin/pg_ctl" -l
"/dev/null" -D "/tmp/olddata" -o "-p 5432 -c autovacuum=off -c
autovacuum_freeze_max_age=2000000000" start >> "/dev/null" 2>&1
Perhaps pg_hba.conf was not set to "trust".

The error had nothing to do with "trust" at all; it was simply that I
tried to use 9.0 binaries with an 8.4 data directory. My patch checks
for this and ensures that the -D bindir is the correct version, just
as the -B datadir has to be the correct version.

I'm not on the mailing list nor do I have a lot of free time to keep
up with normal development, but if there are quick things I can do to
get these patches in let me know.

-Dan

Attachment

pgsql-hackers by date:

Previous
From: Dan Ports
Date:
Subject: Re: pika buildfarm member failure on isolationCheck tests
Next
From: Alvaro Herrera
Date:
Subject: Re: Indication of db-shared tables