Re: Finding the pqlib version - Mailing list pgsql-interfaces

From Greg Sabino Mullane
Subject Re: Finding the pqlib version
Date
Msg-id d456ce1842a622e48df55f61b116564c@biglumber.com
Whole thread Raw
In response to Finding the pqlib version  (Christoph Zwerschke <cito@online.de>)
List 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@turnstep.com
PGP Key: 0x14964AC8 200602110755
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

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

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




pgsql-interfaces by date:

Previous
From: Christoph Zwerschke
Date:
Subject: Finding the pqlib version
Next
From: Peter Eisentraut
Date:
Subject: Re: Finding the pqlib version