Re: Exposing PG_VERSION_NUM in pg_config

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: 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-25 18:03:13
Message-ID: 5512F861.8060500@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3/24/15 6:26 PM, Tom Lane wrote:
> Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> writes:
>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>> Tom> I concur with Michael that there's value in exposing the version
>> Tom> number in the numeric form used by PG_VERSION_NUM. However, I
>> Tom> also concur with Andrew that if the use-case for this is
>> Tom> Makefiles, pg_config is a pretty poor transmission mechanism. We
>> Tom> should instead add PG_VERSION_NUM to the version variables set in
>> Tom> Makefile.global.
>
>> I think there's an argument for both. pg_config already has a VERSION=
>> string in the output, and I think adding a VERSION_NUM= would be good
>> for consistency there. And people definitely do want to do version
>> comparisons in makefiles...
>
> 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? I know I've had to play these games in the past (outside of
a Makefile), though I don't remember the details right now. I'm sure I'm
not alone in that.

Michael's original patch seems to hit everything necessary but the
translations, and it's only ~15 lines. That doesn't seem very
unreasonable to me...
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-03-25 18:50:44 Re: Exposing PG_VERSION_NUM in pg_config
Previous Message Alvaro Herrera 2015-03-25 17:59:54 Re: deparsing utility commands