* type: Bug => Cleanup/optimization
* stage: Unreviewed => Accepted
Comment:
Thanks for the report. `PostgresIndex` is an internal, undocumented API.
However, I agree that `create_sql()` should respect the `using` argument,
so the following diff should be sufficient:
{{{#!diff
diff --git a/django/contrib/postgres/indexes.py
b/django/contrib/postgres/indexes.py
index a0c03681b2..97377d8cb1 100644
--- a/django/contrib/postgres/indexes.py
+++ b/django/contrib/postgres/indexes.py
@@ -25,7 +25,7 @@ class PostgresIndex(Index):
def create_sql(self, model, schema_editor, using="", **kwargs):
self.check_supported(schema_editor)
statement = super().create_sql(
- model, schema_editor, using=" USING %s" % self.suffix,
**kwargs
+ model, schema_editor, using=" USING %s" % (using or
self.suffix), **kwargs
)
with_params = self.get_with_params()
if with_params:
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33607#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.