pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Magnus Hagander <magnus@hagander.net>
Cc: Massa, Harald Armin <chef@ghum.de>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [GENERAL] queriing the version of libpq
Date: Thu, 16 Dec 2010 11:07:56 -0500
Message-ID: <22010.1292515676@sss.pgh.pa.us> (raw)
In-Reply-To: <AANLkTinf_2G3V5cvfx2o1VNDYtvr0u_ntf7c7RH0Gufq@mail.gmail.com>
References: <AANLkTi=q5iTGCjtMN1hv+O4bbCbeX-cWxr0Z2uyqkaUg@mail.gmail.com>
	<AANLkTi=cPLuPn=WDf7r9APz632Pf3qyM8BbEKt5sA0Pd@mail.gmail.com>
	<AANLkTimKHBifr+9a3Nj5A0vbF01oUVfiUxAPPE8U01m_@mail.gmail.com>
	<AANLkTinf_2G3V5cvfx2o1VNDYtvr0u_ntf7c7RH0Gufq@mail.gmail.com>

Magnus Hagander <magnus@hagander.net> writes:
> But it does outline that fact that it wouldn't suck to have a >function  in libpq returning the version so that application can >check this at  runtime - clearly it would also be useful when >being linked "through" something like psycopg2.

> Stuck in a local git branch. I've rebased on current and added docs,
> see attachment.

Ick.  Please get rid of that extra version number.  There is no reason
not to use PG_VERSION_NUM.  The documentation needs further thought too:
grammar needs work, and the format of the result value is unspecified.

But perhaps we should first recheck the premise.  Exactly how will this
function be useful?  I don't believe it's usable in the form implied by
the documentation, namely

	if (PQlibVersion() >= something)
		... call PQspiffyNewFunction() ...
	else
		... do something else ...

because if you're trying to link against an older libpq, the link will
fail before you ever get to execute.  So let's have a less implausible
use-case please.

			regards, tom lane



view thread (18+ messages)  latest in thread

Message-ID: <22010.1292515676@sss.pgh.pa.us>
Permalink:  ../22010.1292515676@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/22010.1292515676@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, magnus@hagander.net, chef@ghum.de, pgsql-hackers@postgresql.org
  Subject: Re: [GENERAL] queriing the version of libpq
  In-Reply-To: <22010.1292515676@sss.pgh.pa.us>
  References: <AANLkTi=q5iTGCjtMN1hv+O4bbCbeX-cWxr0Z2uyqkaUg@mail.gmail.com> <AANLkTi=cPLuPn=WDf7r9APz632Pf3qyM8BbEKt5sA0Pd@mail.gmail.com> <AANLkTimKHBifr+9a3Nj5A0vbF01oUVfiUxAPPE8U01m_@mail.gmail.com> <AANLkTinf_2G3V5cvfx2o1VNDYtvr0u_ntf7c7RH0Gufq@mail.gmail.com> <22010.1292515676@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox