Re: Which header and lib files to use when compiling libpq-code?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Kynn Jones <kynnjo(at)gmail(dot)com>
Cc: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Which header and lib files to use when compiling libpq-code?
Date: 2009-04-27 16:42:56
Message-ID: 20090427164256.GI4676@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Apr 27, 2009 at 12:27:37PM -0400, Kynn Jones wrote:
> On Mon, Apr 27, 2009 at 11:10 AM, Martijn van Oosterhout
> <kleptog(at)svana(dot)org>wrote:
> > In general you don't need to match the server version, the protocol
> > hasn't changed much in a while so as long as it's less than a few
> > years old it'll work.
>
> This statement contradicts the experience I described in my original post:
> the choice of header and/or library files is absolutely critical. The wrong
> choice lead to very bizarre connection failures.

In which case you're going to need to provide a lot more information,
because it really doesn't matter unless you've got really old versions.
The client talks to the server using a socket and if you're getting
memory corruption then it looks more like someone broke your compiler
than that you're not matching the server version.

> But this is not the problem that my question was about. The problem is:
> *how to ensure* that the versions of libpq header and library files used for
> compiling programs will work properly with a specific Postgres server.

You can't really. Any libpq newer than 7.4 (released 2003) should be
able to talk to anything newer 6.4 (released 1998) makes it unlikely
you're going to run into problems compatability-wise.

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Whit Armstrong 2009-04-27 16:45:12 Re: find column OID types with information schema?
Previous Message Tom Lane 2009-04-27 16:38:06 Re: Which header and lib files to use when compiling libpq-code?