Re: Exposing PG_VERSION_NUM in pg_config

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Exposing PG_VERSION_NUM in pg_config
Date: 2015-03-31 21:43:51
Message-ID: CAB7nPqRJB2Ep_RX-R0KYrxpZF+Gx9kht3hKW79ZM1RvDJN-S4Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 1, 2015 at 4:09 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
> > On Tue, Mar 31, 2015 at 9:40 AM, Peter Eisentraut <peter_e(at)gmx(dot)net>
> wrote:
> >> I'm interested in the exact syntax you'd use, to compare it to the
> >> currently used techniques.
>
> > With the presence of VERSION_NUM directly in pg_config, the following
> > expression:
> > VERSION_NUM=$(shell $(PG_CONFIG) --version-num)
>
> > With its presence in Makefile.global, that's close to what you can do
> with
> > pg_config.h already:
> > VERSION_NUM := $(shell cat `$(PG_CONFIG)
> --libdir`/pgxs/src/Makefile.global
> > \
> > | perl -ne 'print $$1 and exit if /VERSION_NUM =\s+(\d+)/')
> > But that looks a little bit magic..
>
> I'm confused. If PG_VERSION_NUM is defined in Makefile.global, surely
> you don't need anything at all to make use of it in extension makefiles.
>

No, you don't... But well, coming back to the first point: fetching it
through pg_config avoids any ugly parsing logic.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2015-03-31 23:50:51 Re: Exposing PG_VERSION_NUM in pg_config
Previous Message Bruce Momjian 2015-03-31 21:06:49 Re: printing table in asciidoc with psql