Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#27135 closed Cleanup/optimization (fixed)

Standardise type value returned by introspection.get_constraints for indexes

Reported by: Akshesh Doshi Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords: introspection db-indexes 1.11
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently, Django supports introspection of index type for PostgreSQL and would be supporting it for other backends as well in future.

Currently the value returned for type is arbitrary but it would be better to set a standard values associated with each index types (like using Index.suffix as suggested by Tim Graham). This discussion might make it more clear - https://github.com/django/django/pull/7046#discussion-diff-74431956

Change History (5)

comment:1 by Tim Graham, 8 years ago

Keywords: db-indexes 1.11 added
Triage Stage: UnreviewedAccepted

comment:2 by Tim Graham, 8 years ago

To address this for 1.11, I think all that's involved is having Django's database introspection return 'idx' (Index.suffix) instead of 'btree'. It looks like the other indexes (brin/gin for PostgreSQL) are already returning Index.suffix.

Functionality wise, nothing changes since inspectdb doesn't consider indexes yet (#27060) but this will set expectations for third-party database backends and prevent them from having to change in a future Django release.

comment:3 by Tim Graham, 8 years ago

Has patch: set

comment:4 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: newclosed

In b008f7c:

Fixed #27135 -- Made index introspection return Index.suffix.

comment:5 by Tim Graham <timograham@…>, 8 years ago

In 2f6cdc0:

[1.11.x] Fixed #27135 -- Made index introspection return Index.suffix.

Backport of b008f7cc5655d01817a8825e6317877b43c92181 from master

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