Re: Module dependency on PostgeSQL version

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Thomas Hallgren <thhal(at)mailblocks(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Module dependency on PostgeSQL version
Date: 2004-05-12 04:27:41
Message-ID: 40A1A7BD.3070508@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Thomas Hallgren <thhal(at)mailblocks(dot)com> writes:
>>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.
>
> Wouldn't it be better to just put those #defines in to begin with,
> rather than requiring people to hack on their CPPFLAGS? I don't offhand
> see much need for knowing the PG version at the Makefile level, but I
> do see the usefulness at the C-code level.
>
> I think Joe Conway is already doing something like this for pl/r ...
> leastwise he's shown bits of #ifdef'd code in past email. It would
> be interesting to see the details of his solution.

This is what I currently have:

#if (CATALOG_VERSION_NO <= 200211021)
#define PG_VERSION_73_COMPAT
#elif (CATALOG_VERSION_NO <= 200310211)
#define PG_VERSION_74_COMPAT
#else
#define PG_VERSION_75_COMPAT
#endif

Since CATALOG_VERSION_NO doesn't change between major releases, it seems
to work pretty well.

Joe

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2004-05-12 05:28:35 Re: PostgreSQL pre-fork speedup
Previous Message pgsql 2004-05-12 04:01:23 Re: Configure redux.