From 4563c5d274c6eb6f6938b4b93d864a9db2ad3756 Mon Sep 17 00:00:00 2001 From: Denis Laxalde Date: Fri, 5 Apr 2024 12:42:01 +0200 Subject: [PATCH] docs: document the ALLOCATED ConnStatus value --- docs/api/pq.rst | 1 + psycopg/psycopg/pq/_enums.py | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/api/pq.rst b/docs/api/pq.rst index bbc34f704..a0d304c6e 100644 --- a/docs/api/pq.rst +++ b/docs/api/pq.rst @@ -148,6 +148,7 @@ Enumerations 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. + `ALLOCATED` is only expected to be returned by `PGcancelConn.status`. .. seealso:: :pq:`PQstatus()` and `PQcancelStatus()` return this value. diff --git a/psycopg/psycopg/pq/_enums.py b/psycopg/psycopg/pq/_enums.py index 1f6fcd48c..6b03b0621 100644 --- a/psycopg/psycopg/pq/_enums.py +++ b/psycopg/psycopg/pq/_enums.py @@ -32,6 +32,7 @@ class ConnStatus(IntEnum): CHECK_TARGET = auto() CHECK_STANDBY = auto() ALLOCATED = auto() # Only for cancel connections. + """Connection to the server hasn't been initiated yet.""" class PollingStatus(IntEnum): -- 2.39.5