Re: Exposing PG_VERSION_NUM in pg_config - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: Exposing PG_VERSION_NUM in pg_config
Date
Msg-id 87wq2786y4.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: Exposing PG_VERSION_NUM in pg_config  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Exposing PG_VERSION_NUM in pg_config  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
>>>>> "Michael" == Michael Paquier <michael.paquier@gmail.com> writes:
>> MAJORVERSION is defined in Makefile.global as included by PGXS, fwiw.
Michael> Well, my point is to have something on which you can directlyMichael> 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

-- 
Andrew (irc:RhodiumToad)



pgsql-hackers by date:

Previous
From: Rajeev rastogi
Date:
Subject: Re: Materialiation is slower than non-materialized
Next
From: Robert Haas
Date:
Subject: Re: Abbreviated keys for Numeric