postgres.git / summary / log / commit / refs

commit    79c3012dc2311bdaa4bb135d871d16f103a62966
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Fri Aug 23 14:12:56 2024 +0000
First released in: 18.0, 17.0

    Provide feature-test macros for libpq features added in v17.
    
    As per the policy established in commit 6991e774e, invent macros
    that can be tested at compile time to detect presence of new libpq
    features.  This should make calling code more readable and less
    error-prone than checking the libpq version would be (especially
    since we don't expose that at compile time; the server version is
    an unreliable substitute).
    
    Discussion: https://postgr.es/m/2042418.1724346970@sss.pgh.pa.us


src/interfaces/libpq/libpq-fe.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/interfaces/libpq/libpq-fe.h b/src/interfaces/libpq/libpq-fe.h index 87a6f3df074..ca3e028a512 100644 --- a/src/interfaces/libpq/libpq-fe.h +++ b/src/interfaces/libpq/libpq-fe.h @@ -30,15 +30,32 @@ extern "C" /* * These symbols may be used in compile-time #ifdef tests for the availability - * of newer libpq features. + * of v14-and-newer libpq features. */ +/* Features added in PostgreSQL v14: */ /* Indicates presence of PQenterPipelineMode and friends */ #define LIBPQ_HAS_PIPELINING 1 /* Indicates presence of PQsetTraceFlags; also new PQtrace output format */ #define LIBPQ_HAS_TRACE_FLAGS 1 + +/* Features added in PostgreSQL v15: */ /* Indicates that PQsslAttribute(NULL, "library") is useful */ #define LIBPQ_HAS_SSL_LIBRARY_DETECTION 1 +/* Features added in PostgreSQL v17: */ +/* Indicates presence of PGcancelConn typedef and associated routines */ +#define LIBPQ_HAS_ASYNC_CANCEL 1 +/* Indicates presence of PQchangePassword */ +#define LIBPQ_HAS_CHANGE_PASSWORD 1 +/* Indicates presence of PQsetChunkedRowsMode, PGRES_TUPLES_CHUNK */ +#define LIBPQ_HAS_CHUNK_MODE 1 +/* Indicates presence of PQclosePrepared, PQclosePortal, etc */ +#define LIBPQ_HAS_CLOSE_PREPARED 1 +/* Indicates presence of PQsendPipelineSync */ +#define LIBPQ_HAS_SEND_PIPELINE_SYNC 1 +/* Indicates presence of PQsocketPoll, PQgetCurrentTimeUSec */ +#define LIBPQ_HAS_SOCKET_POLL 1 + /* * Option flags for PQcopyResult */ [parent: 6b1f78d90b5f]