From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Boris Kolpackov <boris@codesynthesis.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Álvaro Herrera <alvaro.herrera@2ndquadrant.com>
Subject: Re: Add version macro to libpq-fe.h
Date: Thu, 17 Jun 2021 13:16:17 -0400
Message-ID: <1026744.1623950177@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoY8PVB39k5d=OZ64Sv7ba0s32TXg9Vp6wLnCuO9cHM2QA@mail.gmail.com>
References: <boris.20210617102439@codesynthesis.com>
<968815.1623936849@sss.pgh.pa.us>
<CA+TgmoY8PVB39k5d=OZ64Sv7ba0s32TXg9Vp6wLnCuO9cHM2QA@mail.gmail.com>
Robert Haas <robertmhaas@gmail.com> writes:
> On Thu, Jun 17, 2021 at 9:34 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I think putting a version number as such in there is a truly
>> horrid idea. However, I could get behind adding a boolean flag
>> that says specifically whether the pipeline feature exists.
> I realize that this kind of feature-based testing is generally
> considered a best practice, but the problem is we're unlikely to do it
> consistently. If we put a version number in there, people will be able
> to test for whatever they want.
We don't really add major new APIs to libpq very often, so I don't
find that too compelling. I do find it compelling that user code
shouldn't embed knowledge about "feature X arrived in version Y".
> Then again, why would pg_config.h be absent?
Likely because somebody decided it was a server-side include rather
than an application-side include.
A more critical point is that if pg_config is present, it'll likely
contain the server version, which might not have a lot to do with the
libpq version. Debian's already shipping things in a way that decouples
those, and I gather Red Hat is moving in that direction too.
I think what people really want to know is "if I try to call
PQenterPipelineMode, will that compile?". Comparing v13 and v14
libpq-fe.h, I see that there is a solution available now:
"#ifdef PQ_QUERY_PARAM_MAX_LIMIT". But depending on that seems
like a bit of a hack, because I'm not sure that it's directly tied
to the pipelining feature.
regards, tom lane
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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, boris@codesynthesis.com, alvaro.herrera@2ndquadrant.com
Subject: Re: Add version macro to libpq-fe.h
In-Reply-To: <1026744.1623950177@sss.pgh.pa.us>
References: <boris.20210617102439@codesynthesis.com> <968815.1623936849@sss.pgh.pa.us> <CA+TgmoY8PVB39k5d=OZ64Sv7ba0s32TXg9Vp6wLnCuO9cHM2QA@mail.gmail.com> <1026744.1623950177@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