summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/schema.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/backends/postgresql/schema.py')
-rw-r--r--django/db/backends/postgresql/schema.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/django/db/backends/postgresql/schema.py b/django/db/backends/postgresql/schema.py
index cc0da85817..1bd72bc0cb 100644
--- a/django/db/backends/postgresql/schema.py
+++ b/django/db/backends/postgresql/schema.py
@@ -40,6 +40,14 @@ class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
)
sql_delete_procedure = "DROP FUNCTION %(procedure)s(%(param_types)s)"
+ def execute(self, sql, params=()):
+ # Merge the query client-side, as PostgreSQL won't do it server-side.
+ if params is None:
+ return super().execute(sql, params)
+ sql = self.connection.ops.compose_sql(str(sql), params)
+ # Don't let the superclass touch anything.
+ return super().execute(sql, None)
+
sql_add_identity = (
"ALTER TABLE %(table)s ALTER COLUMN %(column)s ADD "
"GENERATED BY DEFAULT AS IDENTITY"