Version function/constant docs improved

This commit is contained in:
Daniele Varrazzo 2015-06-02 11:14:22 +01:00
parent 5a21da43ee
commit c2955fb8fc
2 changed files with 11 additions and 8 deletions

View File

@ -199,12 +199,14 @@ functionalities defined by the |DBAPI|_.
.. function:: libpq_version()
Query actual ``libpq`` version loaded.
Return the version number of the ``libpq`` dynamic library loaded as an
integer, in the same format of `~connection.server_version`.
This function throws `NotSupportedError` if it was compiled with
``libpq < 9.1``.
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()`__
.. seealso:: libpq docs for `PQlibVersion()`__.
.. __: http://www.postgresql.org/docs/current/static/libpq-misc.html#LIBPQ-PQLIBVERSION

View File

@ -111,10 +111,11 @@ The module interface respects the standard defined in the |DBAPI|_.
.. 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()`.
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::