This improves the documentation of Error class, which refers to those
in the new pgconn attribute documentation.
Most likely it will be in `~psycopg.pq.ConnStatus.BAD` state;
however it might be useful to verify precisely what went wrong, for
instance checking the `~psycopg.pq.PGconn.needs_password` and
- `~psycopg.pq.PGconn.used_password`.
+ `~psycopg.pq.PGconn.used_password` attributes.
.. versionadded:: 3.1
.. autoattribute:: pgconn_ptr
.. automethod:: get_cancel
+ .. autoattribute:: needs_password
+ .. autoattribute:: used_password
.. autoclass:: PGresult()
@property
def needs_password(self) -> bool:
+ """True if the connection authentication method required a password,
+ but none was available.
+
+ See :pq:`PQconnectionNeedsPassword` for details.
+ """
return bool(impl.PQconnectionNeedsPassword(self._pgconn_ptr))
@property
def used_password(self) -> bool:
+ """True if the connection authentication method used a password.
+
+ See :pq:`PQconnectionUsedPassword` for details.
+ """
return bool(impl.PQconnectionUsedPassword(self._pgconn_ptr))
@property