Re: pg_upgrade - add config directory setting

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Steve Crawford <scrawford(at)pinpointresearch(dot)com>, "Mr(dot) Aaron W(dot) Swenson" <titanofold(at)gentoo(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_upgrade - add config directory setting
Date: 2011-10-10 11:43:41
Message-ID: 201110101143.p9ABhfn04917@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian wrote:
> Bruce Momjian wrote:
> > OK, I have modified the postmaster in PG 9.2 to allow output of the data
> > directory, and modified pg_ctl to use that, so starting in PG 9.2 pg_ctl
> > will work cleanly for config-only directories.
> >
> > I will now work on pg_upgrade to also use the new flag to find the data
> > directory from a config-only install. However, this is only available
> > in PG 9.2, and it will only be in PG 9.3 that you can hope to use this
> > feature (if old is PG 9.2 or later). I am afraid the symlink hack will
> > have to be used for several more years, and if you are supporting
> > upgrades from pre-9.2, perhaps forever.
> >
> > I did find that it is possible to use pg_ctl -w start on a config-only
> > install using this trick:
> >
> > su -l postgres \
> > -c "env PGPORT=\"5432\" /usr/lib/postgresql-9.1/bin/pg_ctl start -w \
> > -t 60 -s -D /var/lib/postgresql/9.1/data/ \
> > -o '-D /etc/postgresql-9.1/ \
> > --data-directory=/var/lib/postgresql/9.1/data/ \
> > --silent-mode=true'"
> >
> > Unfortunately pg_upgrade doesn't support the -o option which would make
> > this possible for pg_upgrade.
> >
> > One idea would be to add -o/-O options to pg_upgrade 9.2 to allow this
> > to work even with old installs, but frankly, this is so confusing I am
> > not sure we want to encourage people to do things like this. Of course,
> > the symlink hack is even worse, so maybe there is some merit to this.
>
> OK, the attached patch adds -o/-O options to pg_upgrade to mimick pg_ctl
> -o, and documents the 'Gentoo method' for allowing pg_upgrade to handle
> pre-9.2 upgrades for config-only installs. I think this closes the
> issue, with no backpatching required for it to work for new PG 9.2.
> Users will have to continue using the symlink method for new PG 9.1.

Applied to head.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-10-10 12:02:27 Re: patch: fix a regress tests
Previous Message Kevin Grittner 2011-10-10 11:25:07 Re: libpq, PQdescribePrepared -> PQftype, PQfmod, no PQnullable