Re: Exposing PG_VERSION_NUM in pg_config

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Exposing PG_VERSION_NUM in pg_config
Date: 2015-03-26 20:32:16
Message-ID: 55146CD0.8080004@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3/25/15 2:00 PM, Andres Freund wrote:
> On 2015-03-25 14:50:44 -0400, Tom Lane wrote:
>> >Jim Nasby<Jim(dot)Nasby(at)BlueTreble(dot)com> writes:
>>> > >On 3/24/15 6:26 PM, Tom Lane wrote:
>>>> > >>Hm. We're all agreed that there's a use case for exposing PG_VERSION_NUM
>>>> > >>to the makefiles, but I did not hear one for adding it to pg_config; and
>>>> > >>doing the former takes about two lines whereas adding a pg_config option
>>>> > >>entails quite a lot of overhead (documentation, translatable help text,
>>>> > >>yadda yadda). So I'm not in favor of doing the latter without a much
>>>> > >>more solid case than has been made.
>> >
>>> > >Why else would you want the version number other than to do some kind of
>>> > >comparison?
>> >
>> >The question is why, if we supply the version number in a make variable,
>> >you would not just use that variable instead of having to do
>> >"$(shell $(PG_CONFIG) --something)". The shell version adds new failure
>> >modes, removes none, and has no redeeming social value that I can see.
> I think using the makefile is preferrable if you have the version
> dependency in the makefile. But if you don't actually use make
> (e.g. stuff not written in C) or you need the detection in configure or
> something, it's different.

Exactly; not every problem can be solved by make. I know I've had to
futz with the output of "SELECT version()" in the past, and I think I've
had to do the same with pg_config --version.
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2015-03-26 21:31:59 Index-only scans with btree_gist
Previous Message Gavin Flower 2015-03-26 20:26:06 Re: INSERT ... ON CONFLICT IGNORE (and UPDATE) 3.0