Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1luIXq-00063u-JT for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jun 2021 17:44:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1luIXo-0001CY-RP for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Jun 2021 17:44:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1luIXo-0001CQ-Jx for pgsql-hackers@lists.postgresql.org; Fri, 18 Jun 2021 17:44:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1luIXm-0000Xk-K5 for pgsql-hackers@lists.postgresql.org; Fri, 18 Jun 2021 17:44:40 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 15IHiXZg1231632; Fri, 18 Jun 2021 13:44:33 -0400 From: Tom Lane To: Alvaro Herrera cc: Boris Kolpackov , pgsql-hackers@lists.postgresql.org Subject: Re: Add version macro to libpq-fe.h In-reply-to: <202106181427.xzfr43ceuwq5@alvherre.pgsql> References: <202106181427.xzfr43ceuwq5@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Fri, 18 Jun 2021 10:27:50 -0400" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <1231576.1624038189.0@sss.pgh.pa.us> Date: Fri, 18 Jun 2021 13:44:33 -0400 Message-ID: <1231631.1624038273@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1231576.1624038189.1@sss.pgh.pa.us> Alvaro Herrera writes: > So I'm +1 on adding this "feature macro". Concretely, how about the attached? (I also got rid of a recently-added extra comma. While the compilers we use might not warn about that, it seems unwise to assume that no user's compiler will.) I guess one unresolved question is whether we want to mention these in the SGML docs. I vote "no", because it'll raise the maintenance cost noticeably. But I can see an argument on the other side. regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="libpq-feature-test-macros-1.patch"; charset="us-ascii" Content-ID: <1231576.1624038189.2@sss.pgh.pa.us> Content-Description: libpq-feature-test-macros-1.patch Content-Transfer-Encoding: quoted-printable diff --git a/src/interfaces/libpq/libpq-fe.h b/src/interfaces/libpq/libpq-= fe.h index ec378705ad..4677c51e1b 100644 --- a/src/interfaces/libpq/libpq-fe.h +++ b/src/interfaces/libpq/libpq-fe.h @@ -28,6 +28,13 @@ extern "C" */ #include "postgres_ext.h" = +/* + * These symbols may be used in compile-time #ifdef tests for the availab= ility + * of newer libpq features. + */ +#define LIBPQ_HAS_PIPELINING 1 +#define LIBPQ_HAS_TRACE_FLAGS 1 + /* * Option flags for PQcopyResult */ @@ -98,7 +105,7 @@ typedef enum PGRES_COPY_BOTH, /* Copy In/Out data transfer in progress */ PGRES_SINGLE_TUPLE, /* single tuple from larger resultset */ PGRES_PIPELINE_SYNC, /* pipeline synchronization point */ - PGRES_PIPELINE_ABORTED, /* Command didn't run because of an abort + PGRES_PIPELINE_ABORTED /* Command didn't run because of an abort * earlier in a pipeline */ } ExecStatusType; = ------- =_aaaaaaaaaa0--