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

Re: Finding the pqlib version

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Finding the pqlib version
Date: 2006-02-11 12:57:36
Message-ID: d456ce1842a622e48df55f61b116564c@biglumber.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

  
> However, there is no such thing as "PQLIB_VERSION_MAJOR".
> Anything else I could query instead?

Call "pg_config --version" and break it into pieces. To make life
easier, meld them back together into a single string with something
like this:

my $serverversion = sprintf("%d%.02d%.02d", $major_ver, $minor_ver, $patch);

Then you can do things like
if ($serverversion >= 80000) ...

and can similarly pass the above to cc via a -D and get some ifdef fun...

- --
Greg Sabino Mullane greg(at)turnstep(dot)com
PGP Key: 0x14964AC8 200602110755
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

-----BEGIN PGP SIGNATURE-----

iD8DBQFD7d8FvJuQZxSWSsgRAhuMAJ4sShLpZWOUUSFVbBqfnS4UB2GuTwCgnpgl
d3HjVGFhiS5H5xNf/M2qllU=
=z7X9
-----END PGP SIGNATURE-----



In response to

pgsql-interfaces by date

Next:From: Peter EisentrautDate: 2006-02-11 13:50:15
Subject: Re: Finding the pqlib version
Previous:From: Christoph ZwerschkeDate: 2006-02-11 10:59:37
Subject: Finding the pqlib version

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