Re: querying the version of libpq

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Greg Sabino Mullane <greg(at)turnstep(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: querying the version of libpq
Date: 2010-10-06 13:54:22
Message-ID: 15727.1286373262@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)net> writes:
> On Wed, Oct 6, 2010 at 14:17, Greg Sabino Mullane <greg(at)turnstep(dot)com> wrote:
>>> But that's build-time, not run-time.
>>
>> Correct, not sure of your point. Is this a problem? Build-time is
>> what we want here (determining the libpq we were built with)

> The original question was how to find this out from python, which
> means at runtime.

> And the pg_lib_version of DBD::Pg clearly doesn't tell you what
> version of libpq it's using, only what it was built against.

> As long as you have libpq 9.0, you can decode the bytea hex thingy,
> irregardless of what version of libpq your <whatever other
> code/library> was linked against.

The problem here is that you might actually be *running* with a
different version of libpq than you built against. This is actually
highly likely if you distribute an executable that dynamically links
to a shared library at runtime. And the dynamic linker will take any
version of libpq.so that has the same major number, meaning that you
cannot assume that it's not 8.4 just because you built against 9.0.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Magnus Hagander 2010-10-06 14:05:35 Re: querying the version of libpq
Previous Message Jonathan Brinkman 2010-10-06 13:39:24 custom search_path reverts to default after DB restore

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2010-10-06 14:05:35 Re: querying the version of libpq
Previous Message Stephen Frost 2010-10-06 13:49:00 Re: host name support in pg_hba.conf