diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/databases.txt | 25 | ||||
| -rw-r--r-- | docs/releases/5.1.txt | 3 |
2 files changed, 28 insertions, 0 deletions
diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt index 1bc787671e..acebfdf348 100644 --- a/docs/ref/databases.txt +++ b/docs/ref/databases.txt @@ -245,6 +245,31 @@ database configuration in :setting:`DATABASES`:: }, } +.. _postgresql-pool: + +Connection pool +--------------- + +.. versionadded:: 5.1 + +To use a connection pool with `psycopg`_, you can either set ``"pool"`` in the +:setting:`OPTIONS` part of your database configuration in :setting:`DATABASES` +to be a dict to be passed to :class:`~psycopg:psycopg_pool.ConnectionPool`, or +to ``True`` to use the ``ConnectionPool`` defaults:: + + DATABASES = { + "default": { + "ENGINE": "django.db.backends.postgresql", + # ... + "OPTIONS": { + "pool": True, + }, + }, + } + +This option requires ``psycopg[pool]`` or :pypi:`psycopg-pool` to be installed +and is ignored with ``psycopg2``. + .. _database-server-side-parameters-binding: Server-side parameters binding diff --git a/docs/releases/5.1.txt b/docs/releases/5.1.txt index b2377608f0..7fc794cd1d 100644 --- a/docs/releases/5.1.txt +++ b/docs/releases/5.1.txt @@ -162,6 +162,9 @@ Database backends to allow specifying :ref:`pragma options <sqlite-init-command>` to set upon connection. +* ``"pool"`` option is now supported in :setting:`OPTIONS` on PostgreSQL to + allow using :ref:`connection pools <postgresql-pool>`. + Decorators ~~~~~~~~~~ |
