summaryrefslogtreecommitdiff
path: root/docs/ref/databases.txt
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ref/databases.txt')
-rw-r--r--docs/ref/databases.txt31
1 files changed, 28 insertions, 3 deletions
diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt
index 2dbf71562f..6755085336 100644
--- a/docs/ref/databases.txt
+++ b/docs/ref/databases.txt
@@ -117,9 +117,6 @@ PostgreSQL notes
Django supports PostgreSQL 12 and higher. `psycopg`_ 3.1.8+ or `psycopg2`_
2.8.4+ is required, though the latest `psycopg`_ 3.1.8+ is recommended.
-.. _psycopg: https://www.psycopg.org/psycopg3/
-.. _psycopg2: https://www.psycopg.org/
-
.. note::
Support for ``psycopg2`` is likely to be deprecated and removed at some
@@ -251,6 +248,31 @@ database configuration in :setting:`DATABASES`::
},
}
+.. _database-server-side-parameters-binding:
+
+Server-side parameters binding
+------------------------------
+
+.. versionadded:: 4.2
+
+With `psycopg`_ 3.1.8+, Django defaults to the :ref:`client-side binding
+cursors <psycopg:client-side-binding-cursors>`. If you want to use the
+:ref:`server-side binding <psycopg:server-side-binding>` set it in the
+:setting:`OPTIONS` part of your database configuration in
+:setting:`DATABASES`::
+
+ DATABASES = {
+ "default": {
+ "ENGINE": "django.db.backends.postgresql",
+ # ...
+ "OPTIONS": {
+ "server_side_binding": True,
+ },
+ },
+ }
+
+This option is ignored with ``psycopg2``.
+
Indexes for ``varchar`` and ``text`` columns
--------------------------------------------
@@ -373,6 +395,9 @@ non-durable <https://www.postgresql.org/docs/current/non-durability.html>`_.
a development machine where you can easily restore the entire contents of
all databases in the cluster.
+.. _psycopg: https://www.psycopg.org/psycopg3/
+.. _psycopg2: https://www.psycopg.org/
+
.. _mariadb-notes:
MariaDB notes