Re: Version defines

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: James William Pye <flaw(at)rhid(dot)com>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Version defines
Date: 2004-10-31 15:02:01
Message-ID: 27557.1099234921@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

James William Pye <flaw(at)rhid(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-10-31 15:15:01 Re: fsync, ext2 on Linux
Previous Message Thomas Hallgren 2004-10-31 14:38:32 Problems with pgxs