From 0b0a1eeb38cd145d933d52ba691c2028611f1bf9 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Wed, 8 Dec 2021 04:11:41 +0100 Subject: [PATCH] Add ConnStatus.CHECK_STANDBY enum value Added in PostgreSQL 14, only visible during connection, if at all. --- docs/api/pq.rst | 4 +++- docs/news.rst | 1 + psycopg/psycopg/pq/_enums.py | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/api/pq.rst b/docs/api/pq.rst index a6933c4a8..6cd77cbe6 100644 --- a/docs/api/pq.rst +++ b/docs/api/pq.rst @@ -108,7 +108,9 @@ Enumerations .. autoclass:: ConnStatus :members: - Other possible status are only seen during the connection phase. + There are other values in this enum, but only `OK` and `BAD` are seen + after a connection has been established. Other statuses might only be seen + during the connection phase and are considered internal. .. seealso:: :pq:`PQstatus()` returns this value. diff --git a/docs/news.rst b/docs/news.rst index 25beb45b6..aa22ec6f5 100644 --- a/docs/news.rst +++ b/docs/news.rst @@ -22,6 +22,7 @@ Psycopg 3.0.6 (unreleased) - Don't raise exceptions on `ServerCursor.close()` if the connection is closed (:ticket:`#173`). - Fail on `Connection.cursor()` if the connection is closed (:ticket:`#174`). +- Add `!CHECK_STANDBY` value to `~pq.ConnStatus` enum. Current release diff --git a/psycopg/psycopg/pq/_enums.py b/psycopg/psycopg/pq/_enums.py index 88e3113ca..f7da0eb2a 100644 --- a/psycopg/psycopg/pq/_enums.py +++ b/psycopg/psycopg/pq/_enums.py @@ -30,6 +30,7 @@ class ConnStatus(IntEnum): CONSUME = auto() GSS_STARTUP = auto() CHECK_TARGET = auto() + CHECK_STANDBY = auto() class PollingStatus(IntEnum): -- 2.47.2