Re: querying the version of libpq - Mailing list pgsql-general

From Dmitriy Igrishin
Subject Re: querying the version of libpq
Date
Msg-id AANLkTinYeZd2CgRsxgdbi+aWHst5_ydXxQh-SrE8x+du@mail.gmail.com
Whole thread Raw
In response to Re: querying the version of libpq  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hey all,

Could you call it as PQlibVersion() or even PQversion() instead of PQlibpqVersion() ?

2010/10/5 Tom Lane <tgl@sss.pgh.pa.us>
Peter Geoghegan <peter.geoghegan86@gmail.com> writes:
> On 5 October 2010 16:33, Greg Sabino Mullane <greg@turnstep.com> wrote:
>>> How does the driver figure it out?
>>
>> DBD::Pg parses pg_config --version, then passes the information
>> to the C programs for directive fiddling. I certainly hope
>> other drivers are doing the same, as libpq varies across
>> major versions a good deal.

> I would imagine that most libpq wrapping drivers use libpq's
> PQserverVersion(), which returns an integer that looks like 90000.

The real problem is that neither of these can be trusted to tell you the
*library* version.  PQserverVersion() is something else altogether,
and I wouldn't want to assume that pg_config exactly matches the library
you're linked to --- if it's even present at all.

We could add a PQlibpqVersion(), maybe, but it would be many years
before client code could rely on that being present.

                       regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
// Dmitriy.


pgsql-general by date:

Previous
From: "Greg Sabino Mullane"
Date:
Subject: Re: querying the version of libpq
Next
From: Magnus Hagander
Date:
Subject: Re: querying the version of libpq