pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Boris Kolpackov <boris@codesynthesis.com>
Cc: pgsql-hackers@lists.postgresql.org
Cc: alvaro.herrera@2ndquadrant.com
Subject: Re: Add version macro to libpq-fe.h
Date: Thu, 17 Jun 2021 09:34:09 -0400
Message-ID: <968815.1623936849@sss.pgh.pa.us> (raw)
In-Reply-To: <boris.20210617102439@codesynthesis.com>
References: <boris.20210617102439@codesynthesis.com>

Boris Kolpackov <boris@codesynthesis.com> writes:
> I am making use of the new pipeline mode added to libpq in
> PostgreSQL 14. At the same time I would still like to support
> older libpq versions by not providing the extended functionality
> that depends on this mode.

Good point.

> The natural way to achieve this in C/C++ is to conditionally
> enable code that depends on the additional APIs based on the
> preprocessor macro. And I could easily do this if libpq-fe.h
> provided a macro containing its version.

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.
Then you'd do something like

#ifdef LIBPQ_HAS_PIPELINING

rather than embedding knowledge of exactly which release
added that.

			regards, tom lane





view thread (26+ messages)  latest in thread

Message-ID: <968815.1623936849@sss.pgh.pa.us>
Permalink:  ../968815.1623936849@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/968815.1623936849@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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, boris@codesynthesis.com, alvaro.herrera@2ndquadrant.com
  Subject: Re: Add version macro to libpq-fe.h
  In-Reply-To: <968815.1623936849@sss.pgh.pa.us>
  References: <boris.20210617102439@codesynthesis.com> <968815.1623936849@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