behaviour. Please refer to the `ConnectionPool` object API for details about
the pool operations.
+.. note:: The connection pool objects are distributed in a package separate
+ from the main `psycopg` package: use ``pip install psycopg[pool]`` or ``pip
+ install psycopg_pool`` to make the `psycopg_pool` package available. See
+ :ref:`pool-installation`.
+
Pool life cycle
---------------
a context manager and can be closed automatically at the end of its ``with``
block::
+ from psycopg_pool import ConnectionPool
+
with ConnectionPool(conninfo, **kwargs) as my_pool:
run_app(my_pool)
-`pool` -- Connection pool implementations
-=========================================
+`!psycopg_pool` -- Connection pool implementations
+==================================================
.. index::
double: Connection; Pool
instance from the rest of the code (especially the
`~ConnectionPool.connection()` method.
+.. note:: The `!psycopg_pool` package is distributed separately from the main
+ `psycopg` package: use ``pip install psycopg[pool]`` or ``pip install
+ psycopg_pool`` to make it available. See :ref:`pool-installation`.
+
The `!ConnectionPool` class
---------------------------
installation`_.
+.. _pool-installation:
+
+Installing the connection pool
+------------------------------
+
+The :ref:`Psycopg connection pools <connection-pools>` are distributed in a
+separate package from the `!psycopg` package itself, in order to allow a
+different release cycle.
+
+In order to use the pool you must install the ``pool`` extra, using ``pip
+install psycopg[pool]``, or install the `psycopg_pool` package separately,
+which would allow to specify the release to install more precisely.
+
+
Handling dependencies
---------------------