Re: querying the version of libpq

From: Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)com>
To: Greg Sabino Mullane <greg(at)turnstep(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: querying the version of libpq
Date: 2010-10-05 15:52:28
Message-ID: AANLkTinNsPfdJ+67cRQTvqrEEwGkEgH09T0A+ov86s_o@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On 5 October 2010 16:33, Greg Sabino Mullane <greg(at)turnstep(dot)com> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: RIPEMD160
>
>
>>> if ($dbh->{pg_lib_version} >= 90000) {
>>>
>>> I'd raise a bug with psycopg2 if it does not provide that information.
>>
>> 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.

--
Regards,
Peter Geoghegan

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Velevitch 2010-10-05 16:08:55 Re: Group By Question
Previous Message Greg Sabino Mullane 2010-10-05 15:33:15 Re: querying the version of libpq

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2010-10-05 15:54:39 Re: configure gaps
Previous Message KaiGai Kohei 2010-10-05 15:49:23 Re: leaky views, yet again