Module dependency on PostgeSQL version

From: Thomas Hallgren <thhal(at)mailblocks(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Module dependency on PostgeSQL version
Date: 2004-05-11 19:06:00
Message-ID: c7r86n$2c9a$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Hammond 2004-05-11 19:19:55 Re: Hacking MySQL Database
Previous Message pgsql 2004-05-11 19:05:42 Configure redux. "WITH LOCATION," what do you think?