Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VR03g-0005zn-7S for pgsql-interfaces@arkaria.postgresql.org; Tue, 01 Oct 2013 13:32:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VR03f-0001OM-Ew for pgsql-interfaces@arkaria.postgresql.org; Tue, 01 Oct 2013 13:32:11 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VQz40-0005zt-Lj for pgsql-interfaces@postgresql.org; Tue, 01 Oct 2013 12:28:28 +0000 Received: from mail-ee0-f47.google.com ([74.125.83.47]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VQz3v-0000Ro-Lb for pgsql-interfaces@postgresql.org; Tue, 01 Oct 2013 12:28:27 +0000 Received: by mail-ee0-f47.google.com with SMTP id d49so3349013eek.20 for ; Tue, 01 Oct 2013 05:28:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:reply-to:organization :message-id:to:cc:subject:in-reply-to:references:mime-version :content-type:content-transfer-encoding; bh=5MF/hmi/G/MkA0RUY1JhTZOWpLSTE5QN/Rw8FTC9JtI=; b=ZC99+ULfjAOrtfd5SnYp+KnrpPENlN2Tls6/CMnAE7AGxVyqWL9as0nY1IS3cmMHGY JaNkM9sy7ozLB5KvdnQHR0J+harux7nwi7i5ZqukfDJLRbEp4kMF7XTgYUKavFWQ/7sG a0MVGCOuXQ8gTROKPwx2tSlHwu53WkTU2+Mz3CZbDvpVhWPuDjHjSbP58YUBY4xQ/zHY fuwfMNc4F9Ume1YqzQs2BSUjHCdpR0SFsoUAqd82R3hrNhzdRp+A1yLDCkUqr9PL6XjW osj9dvsk3Dsu5MdqIh+Eq8d854HTvkYr38o2EqvZpdE7jLSrNyLnTfLJbNJ6vro5Hx6X bEcw== X-Gm-Message-State: ALoCoQnCVNWTQmBY6WB0090HT4+jZDs5y6KygeffwyTT6ZBIzU8qSKemKhUTcXaeho3iTJPyptJl X-Received: by 10.14.219.198 with SMTP id m46mr45120311eep.41.1380630501706; Tue, 01 Oct 2013 05:28:21 -0700 (PDT) Received: from [192.168.1.102] (135-30-124-91.pool.ukrtel.net. [91.124.30.135]) by mx.google.com with ESMTPSA id k7sm12716314eeg.13.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 01 Oct 2013 05:28:20 -0700 (PDT) Date: Tue, 1 Oct 2013 15:28:20 +0300 From: Pavel Golub Reply-To: Pavel Golub Organization: Microolap X-Priority: 3 (Normal) Message-ID: <113082781.20131001152820@gf.microolap.com> To: Sebastien FLAESCH CC: pgsql-interfaces@postgresql.org Subject: Re: libpq compatibility policy across versions In-Reply-To: <522F0B6B.1040006@4js.com> References: <522F0B6B.1040006@4js.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-interfaces Precedence: bulk Sender: pgsql-interfaces-owner@postgresql.org Hello, Sebastien. You wrote: SF> Hi all, SF> We have a libpq client application written in C. SF> We want to deliver the software so that can it be used with different SF> PostgreSQL client versions, from 8.3 to 9.3 (and future versions). SF> So far, we build (compile and link) a binary with each major version SF> of PostgreSQL (8.3, 8.4, 9.0, 9.1, 9.2, 9.3) - in fact we have shared SF> libraries (database driver) for each PostgreSQL version. SF> Is this the proper way, or could we just compile/link with a given SF> version (9.3) and assume that it's backward compatible with any SF> prior version such as 8.3 ? Yes, you should use the latest client library. It's compatible with all prior versions. SF> Assuming that we could dynamically load the libpq.so client, search SF> for existing API symbols and only use them if present? SF> Is this risky? Do the C headers define C structures that are compatible SF> between newer and older versions? SF> I would expect some note about libpq compatibility policy here: SF> http://www.postgresql.org/docs/9.3/static/libpq-build.html SF> I can see that the lib version number of libpq.so.x.y changes SF> for each major version: SF> /opt3/dbs/pgs/9.2/lib/libpq.so -> libpq.so.5.5 SF> /opt3/dbs/pgs/9.2/lib/libpq.so.5 -> libpq.so.5.5 SF> /opt3/dbs/pgs/9.2/lib/libpq.so.5.5 SF> /opt3/dbs/pgs/9.3.0/lib/libpq.so -> libpq.so.5.6 SF> /opt3/dbs/pgs/9.3.0/lib/libpq.so.5 -> libpq.so.5.6 SF> /opt3/dbs/pgs/9.3.0/lib/libpq.so.5.6 SF> The binaries are dependent from libpq.so.5: SF> $ ldd -r dbmpgs92x.so SF> ... SF> libpq.so.5 => /opt3/dbs/pgs/9.2.3/lib/libpq.so.5 (0xb77bb000) SF> ... SF> What does this mean? SF> Theoritically, a binary linked in a 9.3 env can use le libpq.so version SF> of a prior version down to 8.2 ... (8.1 has libpq.so.4) SF> The main question is about C header compatibility: SF> - Compile + link with PostgreSQL client version X.Y.? SF> - What PostgreSQL client version can be used at runtime? SF> Thanks. SF> Seb -- With best wishes, Pavel mailto:pavel@gf.microolap.com -- Sent via pgsql-interfaces mailing list (pgsql-interfaces@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-interfaces