Re: pg_migrator mention in documentation

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: pg_migrator mention in documentation
Date: 2009-07-02 18:35:32
Message-ID: 20090702183532.GG4698@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut wrote:
> On Friday 19 June 2009 00:56:42 Bruce Momjian wrote:
>
> > > The makefile for pg_migrator currently assumes by default that it is
> > > located under contrib/. Which confuses me.
> >
> > You can compile pg_migrator by copying it to /contrib, or using PGXS;
> > both work. Read the 15-step install instructions for details:
> >
> > (7) Build pg_migrator
> >
> > For pg_migrator source installs, keep in mind the compile must use the
> > _new_ PostgreSQL source directory and be installed in the new Postgres
> > install directory.
> >
> > The simplest build option is to point to the top of the PostgreSQL
> > source tree by running something like:
> >
> > gmake top_builddir=/usr/src/pgsql install
> >
> > Replace '/usr/src/pgsql' with your source directory. pg_migrator also
> > understands the 'prefix=' specification if you installed Postgres in a
> > custom location. Another build option is to copy the pg_migrator
> > directory into contrib/pg_migrator in the new PostgreSQL source tree and
> > run a simple 'gmake install'. A third install method is to use PGXS
> > (assuming the new 'pg_config' is in your $PATH):
> >
> > USE_PGXS=1 gmake prefix=/usr/local/pgsql.new install
>
> Maybe the latter method should be the default, as it matches better with how
> we encourage other extension modules to be built?

I wonder why we have two ways at all (I'm not counting the stuff about
copying it to contrib because it seems pointless). The other day I was
looking at orafce code in pgfoundry, and at clearxlogtail too IIRC, and
they both had the "ifdef USE_PGXS" stuff in the Makefile. I wonder why.
Why not just rip the "ifdef" line and the non-PGXS code, and just use
PGXS always?

It seems to me like module authors are just copying the contrib
Makefiles without stopping to think that the Makefiles could be a lot
shorter if they got rid of the non-PGXS part, which provides no extra
value. More concretely,

*** Makefile.orig 2009-07-02 14:35:03.000000000 -0400
--- Makefile 2009-07-02 14:35:08.000000000 -0400
***************
*** 15,26 ****
PG_CPPFLAGS += -g -O0 -Wall -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wcast-align
endif

- ifdef USE_PGXS
PGXS := $(shell pg_config --pgxs)
include $(PGXS)
- else
- subdir = contrib/pg_migrator/src
- top_builddir = ../../..
- include $(top_builddir)/src/Makefile.global
- include $(top_srcdir)/contrib/contrib-global.mk
- endif
--- 15,19 ----

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chris Browne 2009-07-02 18:40:57 Re: 8.5 development schedule
Previous Message Robert Haas 2009-07-02 18:27:28 Re: Query progress indication - an implementation