Already implemented in 3.1.10, but kept as internal implementation.
Fix #1138
.. automethod:: has_hostaddr
.. automethod:: has_pipeline
.. automethod:: has_set_trace_flags
+ .. automethod:: has_used_gssapi
+
+ .. versionadded:: 3.3
+
.. automethod:: has_cancel_safe
.. note::
.. automethod:: get_cancel
.. autoattribute:: needs_password
.. autoattribute:: used_password
+ .. autoattribute:: used_gssapi
+
+ .. versionadded:: 3.3
.. automethod:: encrypt_password
Psycopg 3.3.0 (unreleased)
^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. rubric:: New top-level features
+
- Cursors are now iterators, not only iterables. This means you can call
``next(cur)`` to fetch the next row (:ticket:`#1064`).
-- Drop support for Python 3.8 (:ticket:`#976`) and 3.9 (:ticket:`#1056`).
- Add `Cursor.results()` to iterate over the result sets of the queries
executed though `~Cursor.executemany()` or `~Cursor.execute()`
(:ticket:`#1080`).
+.. rubric:: New libpq wrapper features
+
+- Add `pq.PGconn.used_gssapi` attribute and `Capabilities.has_used_gssapi()`
+ function (:ticket:`#1138`).
+
+.. rubric:: Other changes
+
+- Drop support for Python 3.8 (:ticket:`#976`) and 3.9 (:ticket:`#1056`).
+
Psycopg 3.2.10 (unreleased)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
"""
return self._has_feature("PGconn.set_trace_flags()", 140000, check=check)
+ def has_used_gssapi(self, check: bool = False) -> bool:
+ """Check if the `pq.PGconn.used_gssapi` attribute is implemented.
+
+ The feature requires libpq 16.0 or greater.
+ """
+ return self._has_feature("PGconn.used_gssapi", 160000, check=check)
+
def has_cancel_safe(self, check: bool = False) -> bool:
"""Check if the `Connection.cancel_safe()` method is implemented.
@property
def used_gssapi(self) -> bool:
+ """True if the connection authentication method used GSSAPI.
+
+ See :pq:`PQconnectionUsedGSSAPI` for details.
+ """
return bool(impl.PQconnectionUsedGSSAPI(self._pgconn_ptr))
@property
("has_hostaddr", "Connection.info.hostaddr", 12),
("has_pipeline", "Connection.pipeline()", 14),
("has_set_trace_flags", "PGconn.set_trace_flags()", 14),
+ ("has_used_gssapi", "PGconn.used_gssapi", 16),
("has_cancel_safe", "Connection.cancel_safe()", 17),
("has_stream_chunked", "Cursor.stream() with 'size' parameter greater than 1", 17),
("has_send_close_prepared", "PGconn.send_close_prepared()", 17),