From: Daniele Varrazzo Date: Sun, 3 Apr 2022 23:26:42 +0000 (+0200) Subject: docs: clean up a couple of sentences X-Git-Tag: 3.1~144 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef22ff4323f0debfb88e018a08023d3114c81379;p=thirdparty%2Fpsycopg.git docs: clean up a couple of sentences - New version scheme is "starting from PG 10", not "after PG 10" (also, chunky bit moved from docstring to docs as for most other docs). - The transaction status is of the session, not the server. --- diff --git a/docs/api/objects.rst b/docs/api/objects.rst index 76dc1f1d6..bd3679130 100644 --- a/docs/api/objects.rst +++ b/docs/api/objects.rst @@ -36,6 +36,13 @@ Connection information .. autoattribute:: backend_pid .. autoattribute:: server_version + + The number is formed by converting the major, minor, and revision + numbers into two-decimal-digit numbers and appending them together. + Starting from PostgreSQL 10 the minor version was dropped, so the + second group of digits is always 00. For example, version 9.3.5 is + returned as 90305, version 10.2 as 100002. + .. autoattribute:: error_message .. automethod:: get_parameters diff --git a/psycopg/psycopg/conninfo.py b/psycopg/psycopg/conninfo.py index 11606b567..b6ae17496 100644 --- a/psycopg/psycopg/conninfo.py +++ b/psycopg/psycopg/conninfo.py @@ -205,7 +205,7 @@ class ConnectionInfo: @property def transaction_status(self) -> pq.TransactionStatus: """ - The current in-transaction status of the server. + The current in-transaction status of the session. See :pq:`PQtransactionStatus()`. """ return pq.TransactionStatus(self.pgconn.transaction_status) @@ -223,12 +223,6 @@ class ConnectionInfo: def server_version(self) -> int: """ An integer representing the server version. See :pq:`PQserverVersion()`. - - The number is formed by converting the major, minor, and revision - numbers into two-decimal-digit numbers and appending them together. - After PostgreSQL 10 the minor version was dropped, so the second group - of digits is always 00. For example, version 9.3.5 is returned as - 90305, version 10.2 as 100002. """ return self.pgconn.server_version