summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorOleksandr Shulgin <oleksandr.shulgin@zalando.de>2015-06-01 18:05:11 +0200
committerOleksandr Shulgin <oleksandr.shulgin@zalando.de>2015-06-01 18:05:11 +0200
commit4bb6f9cef2ac2631b2af881d945b770b64fa23bd (patch)
treeb63446b6e55a92c303b706218e2820f494b03d27 /doc
parentd66165232e5fa146bc968680d958c38ebe5b2880 (diff)
downloadpsycopg2-4bb6f9cef2ac2631b2af881d945b770b64fa23bd.tar.gz
Add libpq version discovery
Diffstat (limited to 'doc')
-rw-r--r--doc/src/extensions.rst10
-rw-r--r--doc/src/module.rst6
2 files changed, 16 insertions, 0 deletions
diff --git a/doc/src/extensions.rst b/doc/src/extensions.rst
index dea1041..3f01066 100644
--- a/doc/src/extensions.rst
+++ b/doc/src/extensions.rst
@@ -197,6 +197,16 @@ functionalities defined by the |DBAPI|_.
.. versionadded:: 2.2.0
+.. function:: libpq_version()
+
+ Query actual ``libpq`` version loaded.
+
+ This function throws `NotSupportedError` if it was compiled with
+ ``libpq < 9.1``.
+
+ .. 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..bd6bcf4 100644
--- a/doc/src/module.rst
+++ b/doc/src/module.rst
@@ -109,6 +109,12 @@ 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 contant containing the version of ``libpq`` this `psycopg2`
+ module was compiled with. If this value is ``>= 90100`` then you
+ may query for the actually loaded version of libpq using
+ `~psycopg2.extensions.libpq_version()`.
.. index::