Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#30783 closed New feature (invalid)

Support gin__int_ops option for PostgreSQL intarray.

Reported by: Dmitry Mugtasimov Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords: postgresql
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I would like this https://stackoverflow.com/a/34741985 work out of the box. Right now such arrays are created without ginint_ops option:

2019-09-19 07:50:29,109 DEBUG django.db.backends.schema CREATE INDEX "jobs_job_titles_de0e2f_gin" ON "jobs_job" USING gin ("titles"); (params None)
2019-09-19 07:50:29,424 DEBUG django.db.backends (0.315) CREATE INDEX "jobs_job_titles_de0e2f_gin" ON "jobs_job" USING gin ("titles"); args=None

Change History (2)

comment:1 by Mariusz Felisiak, 5 years ago

Resolution: invalid
Status: newclosed
Summary: Support gin__int_ops option for PostgreSQL intarraySupport gin__int_ops option for PostgreSQL intarray.
Type: UncategorizedNew feature
Version: 2.2master

It is already possible. You can create a custom GinIndex with opclasses using the Meta.indexes option:

    GinIndex(fields=['myfield'], name='my_index_with_custom_operator_class', opclasses=['gin__int_ops'])

comment:2 by Dmitry Mugtasimov, 5 years ago

Thank you so much!

Note: See TracTickets for help on using tickets.
Back to Top