summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/extensions.rst12
-rw-r--r--doc/src/module.rst7
2 files changed, 19 insertions, 0 deletions
diff --git a/doc/src/extensions.rst b/doc/src/extensions.rst
index dea1041..84e1241 100644
--- a/doc/src/extensions.rst
+++ b/doc/src/extensions.rst
@@ -197,6 +197,18 @@ functionalities defined by the |DBAPI|_.
.. versionadded:: 2.2.0
+.. function:: libpq_version()
+
+ Return the version number of the ``libpq`` dynamic library loaded as an
+ integer, in the same format of `~connection.server_version`.
+
+ Raise `~psycopg2.NotSupportedError` if the ``psycopg2`` module was
+ compiled with a ``libpq`` version lesser than 9.1 (which can be detected
+ by the `~psycopg2.__libpq_version__` constant).
+
+ .. seealso:: libpq docs for `PQlibVersion()`__.
+
+ .. __: http://www.postgresql.org/docs/current/static/libpq-misc.html#LIBPQ-PQLIBVERSION
.. _sql-adaptation-objects:
diff --git a/doc/src/module.rst b/doc/src/module.rst
index 8de9f87..bd121e9 100644
--- a/doc/src/module.rst
+++ b/doc/src/module.rst
@@ -109,6 +109,13 @@ The module interface respects the standard defined in the |DBAPI|_.
by the interface. For `psycopg2` is ``pyformat``. See also
:ref:`query-parameters`.
+.. data:: __libpq_version__
+
+ Integer constant reporting the version of the ``libpq`` library this
+ ``psycopg2`` module was compiled with (in the same format of
+ `~connection.server_version`). If this value is lesser than ``90100``
+ then you may query the version of the actually loaded library using the
+ `~psycopg2.extensions.libpq_version()` function.
.. index::