From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvaro.herrera@2ndquadrant.com>
Cc: Boris Kolpackov <boris@codesynthesis.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Add version macro to libpq-fe.h
Date: Fri, 18 Jun 2021 13:44:33 -0400
Message-ID: <1231631.1624038273@sss.pgh.pa.us> (raw)
In-Reply-To: <202106181427.xzfr43ceuwq5@alvherre.pgsql>
References: <202106181427.xzfr43ceuwq5@alvherre.pgsql>
Alvaro Herrera <alvaro.herrera@2ndquadrant.com> 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
Attachments:libpq-feature-test-macros-1.patch (text/x-diff, 901B) downloaddiff --git a/src/interfaces/libpq/libpq-fe.h b/src/interfaces/libpq/libpq-fe.hindex 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 availability+ * 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;
=
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, alvaro.herrera@2ndquadrant.com, boris@codesynthesis.com
Subject: Re: Add version macro to libpq-fe.h
In-Reply-To: <1231631.1624038273@sss.pgh.pa.us>
References: <202106181427.xzfr43ceuwq5@alvherre.pgsql> <1231631.1624038273@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