Re: Exposing PG_VERSION_NUM in pg_config

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема Re: Exposing PG_VERSION_NUM in pg_config
Дата
Msg-id 87a8z26qam.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответ на Re: Exposing PG_VERSION_NUM in pg_config  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Exposing PG_VERSION_NUM in pg_config  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
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
Tom> That's pretty ugly :-(.

Yes. Though shelling out to invoke "test" is ugly in different ways,
even without using perl and regexps as well.
Tom> I concur with Michael that there's value in exposing the versionTom> number in the numeric form used by
PG_VERSION_NUM. However, ITom> also concur with Andrew that if the use-case for this isTom> Makefiles, pg_config is a
prettypoor transmission mechanism.  WeTom> should instead add PG_VERSION_NUM to the version variables set inTom>
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...

-- 
Andrew (irc:RhodiumToad)



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Kevin Grittner
Дата:
Сообщение: Re: INT64_MIN and _MAX
Следующее
От: Andrew Gierth
Дата:
Сообщение: Re: INT64_MIN and _MAX