Re: Version defines - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Version defines
Date
Msg-id 27557.1099234921@sss.pgh.pa.us
Whole thread Raw
In response to Version defines  (James William Pye <flaw@rhid.com>)
Responses Re: Version defines
List pgsql-hackers
James William Pye <flaw@rhid.com> writes:
> Would it be possible to get something along the lines of the attached
> patch in 8? (major,minor,patch,state version defines)

This has been proposed and rejected before, mainly on the grounds that
it would encourage bad programming practices.

At compile time, you should be checking the specific feature you care
about, not a system version number (this is pretty much the entire point
behind Autoconf).  At run time, you need to be making a run-time test
anyway; compiling against version x.y headers does not guarantee
anything about what version you will be executing against at runtime.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Thomas Hallgren
Date:
Subject: Problems with pgxs
Next
From: Tom Lane
Date:
Subject: Re: fsync, ext2 on Linux