Re: pg_migrator mention in documentation

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_migrator mention in documentation
Date: 2009-07-03 17:22:46
Message-ID: 200907031722.n63HMkU17372@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > Tom Lane wrote:
> >> Also, the recommendation to specify prefix here is redundant and
> >> error-prone. It can get the correct prefix from pg_config.
>
> > Again, see my email just posted about using pg_migrator in a
> > multi-pg_config-binary environment.
>
> What's your point? If the wrong pg_config is first in the path,
> PGXS will do the wrong things anyway. Specifying install prefix
> manually is not enough to prevent that.

I already tell them to make sure the new one is first in the path:

A third install method is to use PGXS (assuming the new 'pg_config'
is the first 'pg_config' in your $PATH):

> If the pg_migrator makefiles conformed to the accepted syntax for
> PGXS invocation (click click ... which they do now) then the preferred

Good, thanks.

> solution for this would be to explicitly specify the pg_config
> location, *and nothing else*, on the make command line.
>
> gmake USE_PGXS=1 PG_CONFIG=/path/to/pg_config install

OK, I have updated the INSTALL file to use that and not tell them to
modify their path.

> I'm inclined to agree with Peter that the current documentation
> is just going to confuse people by giving them too many options.
> I would agree with removing the "ifdef USE_PGXS" from the makefiles
> so that the USE_PGXS=1 bit can go away, and then saying
>
> If the new installation's pg_config is first in your path,
> you can just say
> gmake install
> Otherwise, or to be extra sure, say
> gmake PG_CONFIG=/path/to/pg_config install
>
> (Although actually, if that pg_config isn't in your path, the
> installed pg_migrator won't be either. It might be better to just
> say "fix things so that the new installation's executables are
> first in your PATH", and be done with it.)

I am betting many people will do src/pg_migrator to run it. However,
there will be no pg_migrator binary in the old cluster (hopefully) so it
would still find it even it the new cluster is not first in the path.

Here is the new text I am using:

The simplest build option is to use PGXS:

gmake USE_PGXS=1 PG_CONFIG=/usr/local/pgsql/bin/pg_config
install


Another option is to point to the top of the new PostgreSQL source tree
by running something like:

gmake top_builddir=/usr/src/pgsql install

Replace '/usr/src/pgsql' with your new source directory. pg_migrator
also understands the 'prefix=' specification if you installed Postgres
in a custom location.

I am happy to remove the USE_PGXS from the Makefile, but it seems all
the other extensions require that so I want to be consistent.

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

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-07-03 17:35:13 Re: pg_migrator mention in documentation
Previous Message Tom Lane 2009-07-03 17:16:37 Re: 8.5 development schedule