Re: Frustrating issue with PGXS

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Eddie Stanley <eddiewould(at)paradise(dot)net(dot)nz>
Cc: pgsql-hackers(at)postgresql(dot)org, mux(at)elvis(dot)mu(dot)org
Subject: Re: Frustrating issue with PGXS
Date: 2007-06-25 12:08:25
Message-ID: 20070625120825.GE19058@svr2.hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 25, 2007 at 11:42:28PM +1200, Eddie Stanley wrote:
> Hi,
>
> I spent the best part of the day trying to work this out - I was working on a
> system setup with PG 8.2, and wanted to work with 8.3 for development.
>
> I installed as follows:
>
> 1. CVS checkout
> 2. ./configure prefix=~/install_dir
> 3. gmake prefix=~/install_dir
> 4. gmake install prefix=~/install_dir
>
> Got a datastore up and running with initdb; created some test tables, everything
> seemed to be fine.
>
> The problem came when I wanted to build a simple C function - I used the
> following makefile:
>
> MODULES = example
> PGXS := $(shell ~/install_dir/bin/pg_config --pgxs)
> include $(PGXS)
>
> The program compiled fine, however I noticed the compilation was refering to
> files in /usr/pkg (from the 8.2 installation). I would have thought specifing
> the version of pg_config from the 8.3 installation would be sufficent, but it
> wasn't.
>
> In /lib/postgresql/pgxs/src/Makefile.global, I needed to change
>
> PG_CONFIG = pg_config
> to
> PG_CONFIG = ~/install_dir/bin/pg_config
>
> Could this have been avoided if the Makefile.global had
> PG_CONFIG = $(prefix)/bin/pg_config
> ?

I was actually about to post on this just a couple of days ago - it seems
pgxs really needs pg_config to be in your PATH. The quick fix would be for
you to run

PATH=~/install_dir/bin/:$PATH make

That'll make sure your local pg_config gets picked up instaed. That's what
I ended up donig. It's just a workaround, but it's one that works :-)

//Magnus

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2007-06-25 13:13:51 Re: msvc and vista fun
Previous Message Eddie Stanley 2007-06-25 11:42:28 Frustrating issue with PGXS