summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2015-06-02 11:20:28 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2015-06-02 11:20:28 +0100
commit8d4ac25b56cff1ef39ca0d79ea12a3ae0f5a0f51 (patch)
tree3ef69a047bbf2459fa7080b9b6520520229f6b35 /doc/src
parentd66165232e5fa146bc968680d958c38ebe5b2880 (diff)
parentc2955fb8fc95afd288af22444be8fa11e4132717 (diff)
downloadpsycopg2-8d4ac25b56cff1ef39ca0d79ea12a3ae0f5a0f51.tar.gz
Merge branch 'libpq-version'
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::