Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TC3QL-0003F9-QV for pgsql-docs@postgresql.org; Thu, 13 Sep 2012 07:01:17 +0000 Received: from mail-lpp01m010-f46.google.com ([209.85.215.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TC3QI-0003dv-P1 for pgsql-docs@postgresql.org; Thu, 13 Sep 2012 07:01:17 +0000 Received: by lagy9 with SMTP id y9so1698227lag.19 for ; Thu, 13 Sep 2012 00:01:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:reply-to:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=6Sao7oYSsK5fkXmdKLuD3eMweMNp6bKBhnhMILmeUEY=; b=W9Mq7lm7f/tO0B+7ZGUgI1mKE83Ak/7a2JCQxn2OgcTGfURU0rO6i4qsvNT0ShziF2 6Im+8th8pM0ywOV5Bl+DH6bSnWBVgMGBRx2xan/t7tkbO9IpNFZEBsbEvN5O+OAR0MDW I4odrD1BsOGVlarrDS6mI5ZQHyTHklAbrCVvP3WptYRyz47o2g29dDbImbNkNYU0fkp2 tQQ3E0NyJEvQkBmOg6W8tE2aZVh4Z9L6f2rYEqT6rShAbu4cpP/e74YIZVKqHZG7c478 y2H9Ba/0m1vELC/CQ1SzM2owlGel5/XndtjQt9cCXskdQa5/hDm994qOXroVEiDyz4HP pt9g== Received: by 10.152.124.180 with SMTP id mj20mr878028lab.43.1347519674024; Thu, 13 Sep 2012 00:01:14 -0700 (PDT) Received: from [192.168.1.102] (dsl-hkibrasgw2-fedadf00-197.dhcp.inet.fi. [80.223.218.197]) by mx.google.com with ESMTPS id hz16sm22436985lab.6.2012.09.13.00.01.12 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 13 Sep 2012 00:01:13 -0700 (PDT) Message-ID: <505184B6.6050008@iki.fi> Date: Thu, 13 Sep 2012 10:01:10 +0300 From: Heikki Linnakangas Reply-To: hlinnaka@iki.fi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.6esrpre) Gecko/20120817 Icedove/10.0.6 MIME-Version: 1.0 To: Sebastien FLAESCH CC: pgsql-docs@postgresql.org Subject: Re: Details about libpq cross-version compatibility References: <5050A86B.4080601@4js.com> In-Reply-To: <5050A86B.4080601@4js.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201209/5 X-Sequence-Number: 7457 On 12.09.2012 18:21, Sebastien FLAESCH wrote: > I believe there is some info missing in the page describing libpq > programs build: > > http://www.postgresql.org/docs/9.2/interactive/libpq-build.html > > I am working with PostgreSQL for several years now (since V7), > maintaining a set > of "db drivers" for our system, that can be used with the different > PostgreSQL > versions. > > We need to build our binaries for different versions of PostgreSQL, > today it's > from 8.3 to 9.2 ... > > What is the compatibility rule regarding this? > > Can I compile / link with a PostgreSQL 9.1 environment and deploy on 9.2 > ??? > > Can I compile / link with a PostgreSQL 8.x environment and deploy on 9.x > ??? If your binary is just a client application that uses libpq to speak to the server, you can use any (supported) version of libpq with any (supported) server version. There hasn't been any incompatible protocol changes since version 7.4, which introduced the protocol version 3, and even that was done in a backwards-compatible fashion so that even 9.2 server still supports the old version 2 of the protocol. Now, another question is what happens if you compile your binaries against e.g 9.1 version of libpq, but at runtime, you have 9.2 libpq installed. I think that should work too, but not vice versa, if you use any new functions from the 9.2 libpq library. In general, you should have the same or higher version of libpq at runtime that the binaries were built with. The version number bump from 8.x to 9.0 was made because 9.0 introduced many new features, but from a compatibility policy point-of-view, 8.4 -> 9.0 is no different than, say, going from 8.3 to 8.4. > The problem is that we have to ship several versions of the drivers for all > the PostgreSQL versions that are in the support live cycle, today this is > from 8.3 to 9.2 ... That really shouldn't be necessary. > So far, we followed the version policy as described here: > > http://www.postgresql.org/support/versioning > > I think it's ok to follow this rule, but would feel much better if it was > clearly stated in the "Building libpq Programs" page. Agreed. Either that page, or the libpq top page at http://www.postgresql.org/docs/devel/static/libpq.html, or a new "cross-version compatibility" section under that. Could you write up a few paragraphs for the manual please? That would be much appreciated, you'd be in a good position to do that since you're facing the problem right now. - Heikki