summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/psycopg_any.py
diff options
context:
space:
mode:
authorFlorian Apolloner <florian@apolloner.eu>2022-12-12 09:54:49 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-12-12 10:36:45 +0100
commitdb7bb3b64e469fbb5c79e7b5b2fcb890434aa60f (patch)
treefc995dec5ccb21baf840b2303b5e59df67e50bfa /django/db/backends/postgresql/psycopg_any.py
parent1d90c9b1132482d446ca8375c151e894002c9e8d (diff)
downloaddjango-db7bb3b64e469fbb5c79e7b5b2fcb890434aa60f.tar.gz
Refs #33308 -- Added DatabaseOperations.compose_sql() on PostgreSQL.
Diffstat (limited to 'django/db/backends/postgresql/psycopg_any.py')
-rw-r--r--django/db/backends/postgresql/psycopg_any.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/django/db/backends/postgresql/psycopg_any.py b/django/db/backends/postgresql/psycopg_any.py
index 83e8a9f4d3..e9bb84f313 100644
--- a/django/db/backends/postgresql/psycopg_any.py
+++ b/django/db/backends/postgresql/psycopg_any.py
@@ -24,3 +24,8 @@ def _quote(value, connection=None):
sql.quote = _quote
+
+
+def mogrify(sql, params, connection):
+ with connection.cursor() as cursor:
+ return cursor.mogrify(sql, params).decode()