Re: Exposing PG_VERSION_NUM in pg_config

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: 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-24 21:17:55
Message-ID: 7900.1427231875@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> writes:
> "Michael" == Michael Paquier <michael(dot)paquier(at)gmail(dot)com> writes:
> Michael> Well, my point is to have something on which you can directly
> Michael> apply maths on without changing its shape ;)

> There's this trick:

> # if version < 9.1 ...
> ifeq ($(filter-out 7.% 8.% 9.0, $(MAJORVERSION)),)
> # stuff
> endif

> # if version >= 9.3
> ifneq ($(filter-out 7.% 8.% 9.0 9.1 9.2, $(MAJORVERSION)),)
> # stuff
> endif

That's pretty ugly :-(. I concur with Michael that there's value in
exposing the version number in the numeric form used by PG_VERSION_NUM.
However, I also concur with Andrew that if the use-case for this is
Makefiles, pg_config is a pretty poor transmission mechanism.
We should instead add PG_VERSION_NUM to the version variables set in
Makefile.global.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Baker, Keith [OCDUS Non-J&J] 2015-03-24 21:18:54 Re: Zero-padding and zero-masking fixes for to_char(float)
Previous Message Andrew Gierth 2015-03-24 21:12:13 Re: INT64_MIN and _MAX