Re: [GENERAL] queriing the version of libpq - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] queriing the version of libpq
Date
Msg-id 22010.1292515676@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] queriing the version of libpq  (Magnus Hagander <magnus@hagander.net>)
Responses Re: [GENERAL] queriing the version of libpq  (Magnus Hagander <magnus@hagander.net>)
List pgsql-hackers
Magnus Hagander <magnus@hagander.net> writes:
> But it does outline that fact that it wouldn't suck to have a >function �in libpq returning the version so that
applicationcan >check this at �runtime - clearly it would also be useful when >being linked "through" something like
psycopg2.

> Stuck in a local git branch. I've rebased on current and added docs,
> see attachment.

Ick.  Please get rid of that extra version number.  There is no reason
not to use PG_VERSION_NUM.  The documentation needs further thought too:
grammar needs work, and the format of the result value is unspecified.

But perhaps we should first recheck the premise.  Exactly how will this
function be useful?  I don't believe it's usable in the form implied by
the documentation, namely
if (PQlibVersion() >= something)    ... call PQspiffyNewFunction() ...else    ... do something else ...

because if you're trying to link against an older libpq, the link will
fail before you ever get to execute.  So let's have a less implausible
use-case please.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Dmitriy Igrishin
Date:
Subject: Re: [GENERAL] queriing the version of libpq
Next
From: Peter Eisentraut
Date:
Subject: default localtimestamp at time zone