Module dependency on PostgeSQL version - Mailing list pgsql-hackers

From Thomas Hallgren
Subject Module dependency on PostgeSQL version
Date
Msg-id c7r86n$2c9a$1@news.hub.org
Whole thread Raw
Responses Re: Module dependency on PostgeSQL version  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Module dependency on PostgeSQL version  ("Greg Sabino Mullane" <greg@turnstep.com>)
List pgsql-hackers
I'd like to make a small suggestion that would enable external modules 
to manage dependencies to PostgreSQL versions. Consider the following code:

#if PGSQL_MAJOR_VER > 7 || (PGSQL_MAJOR_VER == 7 && PGSQL_MINOR_VER > 4)    result = HeapTupleGetDatum(tuple);
#else    /* PostgreSQL 7.4 or earlier     */    TupleTableSlot* slot = TupleDescGetSlot(tupleDesc);    result =
TupleGetDatum(slot,tuple);
 
#endif

The PGSQL_MAJOR_VER and PGSQL_MINOR_VER does not exist today. Ideally, 
I'd like to find them in src/Makefile.global. Only thing present seems 
to be the VERSION. I'd like to see something like:

PGSQL_MAJOR_VER := 7
PGSQL_MINOR_VER := 5
PGSQL_PATCH_VER := devel
VERSION := $(PGSQL_MAJOR_VER).$(PGSQL_MINOR_VER).$(PGSQL_PATCH_VER)

To be used in CPPFLAGS as: -DPGSQL_MAJOR_VER=$(PGSQL_MAJOR_VER) etc.

The alternative for me (and others who undoubtedly will encounter the 
same problem) is to invent something ugly to split the current VERSION 
variable. Considering ease of extension of PostgreSQL, I wanted to 
suggest this first.

Kind regards,

Thomas Hallgren




pgsql-hackers by date:

Previous
From: pgsql@mohawksoft.com
Date:
Subject: Configure redux. "WITH LOCATION," what do you think?
Next
From: Mike Mascari
Date:
Subject: Re: SPI and bytea columns