Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6991e77

Browse files
committed
Provide feature-test macros for libpq features added in v14.
We had a request to provide a way to test at compile time for theavailability of the new pipeline features. More generally, itseems like a good idea to provide a way to test via #ifdef forall new libpq API features. People have been using the versionfrom pg_config.h for that; but that's more likely to represent theserver version than the libpq version, in the increasingly-commonscenario where they're different. It's safer if libpq-fe.h itselfis the source of truth about what features it offers.Hence, establish a policy that starting in v14 we'll add a suitablefeature-is-present macro to libpq-fe.h when we add new API there.(There doesn't seem to be much point in applying this policyretroactively, 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
1 parent2731ce1 commit6991e77

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

‎src/interfaces/libpq/libpq-fe.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ extern "C"
2828
*/
2929
#include"postgres_ext.h"
3030

31+
/*
32+
* These symbols may be used in compile-time #ifdef tests for the availability
33+
* of newer libpq features.
34+
*/
35+
/* Indicates presence of PQenterPipelineMode and friends */
36+
#defineLIBPQ_HAS_PIPELINING 1
37+
/* Indicates presence of PQsetTraceFlags; also new PQtrace output format */
38+
#defineLIBPQ_HAS_TRACE_FLAGS 1
39+
3140
/*
3241
* Option flags for PQcopyResult
3342
*/
@@ -98,7 +107,7 @@ typedef enum
98107
PGRES_COPY_BOTH,/* Copy In/Out data transfer in progress */
99108
PGRES_SINGLE_TUPLE,/* single tuple from larger resultset */
100109
PGRES_PIPELINE_SYNC,/* pipeline synchronization point */
101-
PGRES_PIPELINE_ABORTED,/* Command didn't run because of an abort
110+
PGRES_PIPELINE_ABORTED/* Command didn't run because of an abort
102111
* earlier in a pipeline */
103112
}ExecStatusType;
104113

@@ -398,7 +407,7 @@ extern pgthreadlock_t PQregisterThreadLock(pgthreadlock_t newhandler);
398407
externvoidPQtrace(PGconn*conn,FILE*debug_port);
399408
externvoidPQuntrace(PGconn*conn);
400409

401-
/* flags controlling trace output */
410+
/* flags controlling trace output: */
402411
/* omit timestamps from each line */
403412
#definePQTRACE_SUPPRESS_TIMESTAMPS(1<<0)
404413
/* redact portions of some messages, for testing frameworks */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp