pgsql: Provide feature-test macros for libpq features added in v14.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Provide feature-test macros for libpq features added in v14.
Date: 2021-06-19 15:44:50
Message-ID: E1lud9O-0003Ns-PD@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Provide feature-test macros for libpq features added in v14.

We had a request to provide a way to test at compile time for the
availability of the new pipeline features. More generally, it
seems like a good idea to provide a way to test via #ifdef for
all new libpq API features. People have been using the version
from pg_config.h for that; but that's more likely to represent the
server version than the libpq version, in the increasingly-common
scenario where they're different. It's safer if libpq-fe.h itself
is the source of truth about what features it offers.

Hence, establish a policy that starting in v14 we'll add a suitable
feature-is-present macro to libpq-fe.h when we add new API there.
(There doesn't seem to be much point in applying this policy
retroactively, but it's not too late for v14.)

Tom Lane and Alvaro Herrera, per suggestion from Boris Kolpackov.

Discussion: https://postgr.es/m/boris.20210617102439@codesynthesis.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6991e774e0304f5ef488cf1ae4fa79578b6ae3d5

Modified Files
--------------
src/interfaces/libpq/libpq-fe.h | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2021-06-20 15:49:02 pgsql: Stabilize test case added by commit f61db909d.
Previous Message Amit Kapila 2021-06-19 06:10:38 pgsql: Handle no replica identity index case in RelationGetIdentityKeyB