[pgpool-hackers: 1612] Re: Optionally Read PG_CONFIG Environment Variable

Bo Peng pengbo at sraoss.co.jp
Thu Jun 9 15:03:11 JST 2016


Hi,

Your proposal was committed into the development repository.
Please check the following commit.

https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=51653dfbc73269b2285466f5a259ad2b613ef0b0

Best regards,

On Wed, 8 Jun 2016 06:59:54 -0400
"Aaron W. Swenson" <titanofold at gentoo.org> wrote:

> Hello all!
> 
> I’m the maintainer of the pgpool-II package on Gentoo Linux.
> 
> Like most other distros, our users are able to emerge/install multiple
> major versions of PostgreSQL side-by-side; they can have 9.4 and 9.5
> available and running on the system at the same time. This is known as
> slotting.
> 
> One of the things I’m currently working on is an eclass (a kind of
> helper library) that allows a package to install to all versions of
> PostgreSQL installed.
> 
> One of the ways the eclass conveys which slot to build and install
> against is by setting the PG_CONFIG variable to the absolute path of
> pg_config, (e.g., /usr/lib64/postgresql-9.5/bin/pg_config).
> 
> Another way is through string manipulation. It’ll find specific tokens
> in a string, replace them with the values relevant for the particular
> slot it’s working on, then pass the manipulated string on to whatever it
> needs to be passed to. For example:
> 
>     pg_multi_foreach econf --with-pgsql=…@PG_SLOT@…
> 
> Becomes:
> 
>     configure --with-pgsql=…9.5…
> 
> In the course of working with this eclass and the pgpool-II package I’ve
> run into an issue with pgpool-II only building and installing against
> one PostgreSQL slot, whichever one is set by the user as the default.
> 
> As a result, this prevents pgpool-II from being installed to, and usable
> by, all PostgreSQL slots. This poses several problems, chief of which is
> ease of migrating databases.
> 
> The solution to this particular problem is simple: Instruct GNU make to
> not ignore and override the value of the environment variable
> PG_CONFIG. Right now, the Makefiles set PG_CONFIG to pg_config, which
> when called within $(shell) just finds the first pg_config in PATH.
> 
> I have opened a bug about this at:
> 
>     http://www.pgpool.net/mantisbt/view.php?id=178
> 
> And I’ve attached the patch as well.
> 
> It just makes the following change:
> 
>     -PG_CONFIG = pg_config
>     +PG_CONFIG ?= pg_config
> 
> Throughout the Makefiles. This allows GNU make to set PG_CONFIG if it
> hasn’t already been set in the environment.
> 
> This would benefit more than just Gentoo as others may want to build and
> install pgpool-II against a PostgreSQL that resides outside the default
> path.
> 
> Thank you for your consideration.


-- 
Bo Peng <pengbo at sraoss.co.jp>



More information about the pgpool-hackers mailing list