Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] how solve diff of API counstruct_md_array between

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Joe Conway <mail(at)joeconway(dot)com>, Pavel Stehule <pavel(dot)stehule(at)hotmail(dot)com>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] how solve diff of API counstruct_md_array between
Date: 2006-02-28 05:45:18
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches
I have developed a patch which creates a new pg_config.h define called
PG_VERSION_NUM, which is a number like 80200, with no beta/devel
designation.  I think this will be helpful (eventually) for people
writing plug-ins.  Attached.


Martijn van Oosterhout wrote:
-- Start of PGP signed section.
> On Fri, Feb 24, 2006 at 02:57:19PM -0500, Bruce Momjian wrote:
> > Yea, that is probably the best you can do currently, but it is pretty
> > ugly.  We have PQserverVersion() in libpq for use by clients, which
> > does:
> > 
> >             conn->sversion = (100 * vmaj + vmin) * 100 + vrev;
> > 
> > Perhaps we should have a function in the server that has this. 
> > PG_VERSION isn't easy to use because it is a string, and changes during
> > minor versions.
> We don't need a function to do it, because none of that can be used by
> a compiler. If a structure gains or loses a member, the only way you
> can do it portibly is if the compiler can determine which version to
> use. The only thing the preprocessor can use is:
> - Is a (preprocessor) symbol defined
> - Is it numerically greater equal or less than another number
> So the only solution would be something like:
> Or
> #define POSTGRESQL_VERSION 80101
> Maybe something to indicate beta or CVS. Anything else is not likely to
> be an improvement on what we have now. Besides, adding stuff now is not
> terribly useful since people want to support back to 7.3/7.4 and until
> a new scheme is old enough that 8.2 is ancient (first release it could
> possibly appear in) it won't get a lot of usage.
> Have a nice day,
> -- 
> Martijn van Oosterhout   <kleptog(at)svana(dot)org>
> > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> > tool for doing 5% of the work and then sitting around waiting for someone
> > else to do the other 95% so you can sue them.
-- End of PGP section, PGP failed!

  Bruce Momjian
  SRA OSS, Inc.

  + If your life is a hard drive, Christ can be your backup. +

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2006-02-28 06:04:00
Subject: Re: Dead Space Map
Previous:From: SuvarnaDate: 2006-02-28 05:35:16
Subject: bug in 7.3.2

pgsql-patches by date

Next:From: Martijn van OosterhoutDate: 2006-02-28 13:49:07
Subject: Re: [HACKERS] how solve diff of API counstruct_md_array between
Previous:From: Tom LaneDate: 2006-02-27 23:20:36
Subject: Re: Scrollable cursors and Sort performance

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group