From 095493a3771a99d0e4c906ad1cc33791efaa7248 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Mon, 11 Mar 2024 17:20:36 +0100 Subject: [PATCH] Add missing connection statuses to docs The list of connection statuses that PQstatus might return during an asynchronous connection attempt was outdated: 1. CONNECTION_SETENV is never returned anymore and is only part of the enum for backwards compatibility, so remove it from the docs. 2. CONNECTION_CHECK_STANDBY and CONNECTION_GSS_STARTUP were not listed, so add them. CONNECTION_NEEDED and CONNECTION_CHECK_TARGET are not listed in the docs on purpose, since these are internal states that can never be observed by a caller of PQstatus. Author: Jelte Fennema-Nio Discussion: https://postgr.es/m/CAGECzQRb21spiiykQ48rzz8w+Hcykz+mB2_hxR65D9Qk6nnw=w@mail.gmail.com --- doc/src/sgml/libpq.sgml | 15 ++++++++++++--- src/interfaces/libpq/libpq-fe.h | 5 +++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 1d8998efb2a..a2bbf33d029 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -428,11 +428,11 @@ PostgresPollingStatusType PQconnectPoll(PGconn *conn); - - CONNECTION_SETENV + + CONNECTION_GSS_STARTUP - Negotiating environment-driven parameter settings. + Negotiating GSS encryption. @@ -446,6 +446,15 @@ PostgresPollingStatusType PQconnectPoll(PGconn *conn); + + CONNECTION_CHECK_STANDBY + + + Checking if connection is to a server in standby mode. + + + + CONNECTION_CONSUME diff --git a/src/interfaces/libpq/libpq-fe.h b/src/interfaces/libpq/libpq-fe.h index defc415fa3f..2c06044a75e 100644 --- a/src/interfaces/libpq/libpq-fe.h +++ b/src/interfaces/libpq/libpq-fe.h @@ -73,11 +73,12 @@ typedef enum * backend startup. */ CONNECTION_SETENV, /* This state is no longer used. */ CONNECTION_SSL_STARTUP, /* Negotiating SSL. */ - CONNECTION_NEEDED, /* Internal state: connect() needed */ + CONNECTION_NEEDED, /* Internal state: connect() needed. */ CONNECTION_CHECK_WRITABLE, /* Checking if session is read-write. */ CONNECTION_CONSUME, /* Consuming any extra messages. */ CONNECTION_GSS_STARTUP, /* Negotiating GSSAPI. */ - CONNECTION_CHECK_TARGET, /* Checking target server properties. */ + CONNECTION_CHECK_TARGET, /* Internal state: checking target server + * properties. */ CONNECTION_CHECK_STANDBY /* Checking if server is in standby mode. */ } ConnStatusType; -- 2.39.5