Alvaro Herrera <alvaro.herr...@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

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 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 via email to