Fixing pg_upgrade's check of available binaries

Started by Tom Laneover 15 years ago2 messageshackers
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

I've been fooling around with creating upgrade-in-place support for the
Fedora/RHEL RPMs. What I want to have is a separate postgresql-upgrade
RPM containing just the minimum possible set of previous-release files,
together with pg_upgrade itself. Experimenting with this convinced me
that pg_upgrade is a few bricks shy of a load in its tests for whether
the old and new clusters have the right binaries available:

* it insists on pg_dumpall and psql being present in the old cluster,
though they are not in fact called
* it fails to check for pg_resetxlog, even though it needs it in both
old and new clusters
* it fails to check for pg_config, which it does need in the new
cluster. It does not however really need it in the old cluster,
because it has no use for the old cluster's --pkglibdir path.

I propose the attached patch to clean these things up. Any objections?

regards, tom lane

#2Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#1)
Re: Fixing pg_upgrade's check of available binaries

Tom Lane wrote:

I've been fooling around with creating upgrade-in-place support for the
Fedora/RHEL RPMs. What I want to have is a separate postgresql-upgrade
RPM containing just the minimum possible set of previous-release files,
together with pg_upgrade itself. Experimenting with this convinced me
that pg_upgrade is a few bricks shy of a load in its tests for whether
the old and new clusters have the right binaries available:

* it insists on pg_dumpall and psql being present in the old cluster,
though they are not in fact called
* it fails to check for pg_resetxlog, even though it needs it in both
old and new clusters
* it fails to check for pg_config, which it does need in the new
cluster. It does not however really need it in the old cluster,
because it has no use for the old cluster's --pkglibdir path.

I propose the attached patch to clean these things up. Any objections?

Looks good to me. I was not super-strict about checking binaries
because I assumed a full install on both clusters, but it doesn't hurt
to make that more specific.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +