[Django] #22514: Postgres index generator does not expect db_type to be None

23 views
Skip to first unread message

Django

unread,
Apr 25, 2014, 5:36:33 AM4/25/14
to django-...@googlegroups.com
#22514: Postgres index generator does not expect db_type to be None
----------------------------------------------+--------------------
Reporter: vzima | Owner: nobody
Type: Bug | Status: new
Component: Database layer (models, ORM) | Version: 1.6
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------------------+--------------------
Postgres database backend does not expect fields with db_type `None` in
index creation.

Virtual foreign relation can have unique set up to enable model-instance
cache. I attach a patch and a test.

--
Ticket URL: <https://code.djangoproject.com/ticket/22514>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 29, 2014, 7:25:24 AM4/29/14
to django-...@googlegroups.com
#22514: Postgres index generator does not expect db_type to be None
-------------------------------------+-------------------------------------

Reporter: vzima | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 1.6
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by timo):

* needs_better_patch: => 0
* needs_docs: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:1>

Django

unread,
May 19, 2014, 12:24:33 PM5/19/14
to django-...@googlegroups.com
#22514: Postgres index generator does not expect db_type to be None
-------------------------------------+-------------------------------------
Reporter: vzima | Owner: vzima
Type: Bug | Status: assigned

Component: Database layer | Version: 1.6
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by vzima):

* owner: nobody => vzima
* status: new => assigned
* has_patch: 0 => 1
* stage: Accepted => Ready for checkin


Comment:

I've made a PR from the patch.

PR: https://github.com/django/django/pull/2687

This patch only patches up the postgres issue. It might be worth to not
generate indexes on virtual fields in general.

--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:2>

Django

unread,
May 20, 2014, 9:27:38 AM5/20/14
to django-...@googlegroups.com
#22514: Postgres index generator does not expect db_type to be None
-------------------------------------+-------------------------------------
Reporter: vzima | Owner: vzima
Type: Bug | Status: assigned
Component: Database layer | Version: 1.6
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Ready for
Keywords: | checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timo):

In the future, please do not mark your own patch as "Ready for checkin".
You need to get a second set of eyes to review the patch and then that
person can do that. While I don't object to fixing this and am looking at
it, note the following deprecation for 2.0: "The DatabaseCreation class on
each database backend will be removed, and all table/schema editing will
be moved to be via SchemaEditor instead." I guess you may want to see if
this issue exists there as well.

--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:3>

Django

unread,
May 20, 2014, 10:37:12 AM5/20/14
to django-...@googlegroups.com
#22514: Postgres index generator does not expect db_type to be None
-------------------------------------+-------------------------------------
Reporter: vzima | Owner: vzima
Type: Bug | Status: assigned
Component: Database layer | Version: 1.6
(models, ORM) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0

Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by vzima):

* stage: Ready for checkin => Accepted


Comment:

Sorry, I mixed it up with "Ready for code review".

I've run into this issue in 1.6. There is a chance this bug lives on
multiple places, but I'd be happier if somebody more familiar with the ORM
core check it out.

--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:4>

Django

unread,
Jun 20, 2014, 11:59:43 AM6/20/14
to django-...@googlegroups.com
#22514: Postgres index generator does not expect db_type to be None
-------------------------------------+-------------------------------------
Reporter: vzima | Owner: vzima
Type: Bug | Status: closed

Component: Database layer | Version: 1.6
(models, ORM) | Resolution: fixed

Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"78c32f1caa9cb9b28be2d867aff586a2016122ed"]:
{{{
#!CommitTicketReference repository=""
revision="78c32f1caa9cb9b28be2d867aff586a2016122ed"
Fixed #22514 -- Prevented indexes on virtual fields [postgres].
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:5>

Django

unread,
Jun 20, 2014, 12:44:32 PM6/20/14
to django-...@googlegroups.com
#22514: Postgres index generator does not expect db_type to be None
-------------------------------------+-------------------------------------
Reporter: vzima | Owner: vzima
Type: Bug | Status: closed
Component: Database layer | Version: 1.6
(models, ORM) | Resolution: fixed
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by vzima):

Is there any chance for a backport to 1.6? That version is also affected.

--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:6>

Django

unread,
Jun 20, 2014, 12:49:36 PM6/20/14
to django-...@googlegroups.com
#22514: Postgres index generator does not expect db_type to be None
-------------------------------------+-------------------------------------
Reporter: vzima | Owner: vzima
Type: Bug | Status: closed
Component: Database layer | Version: 1.6
(models, ORM) | Resolution: fixed
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by timo):

Not unless it's a regression from 1.5.

--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:7>

Django

unread,
Jun 20, 2014, 1:05:16 PM6/20/14
to django-...@googlegroups.com
#22514: Postgres index generator does not expect db_type to be None
-------------------------------------+-------------------------------------
Reporter: vzima | Owner: vzima
Type: Bug | Status: closed
Component: Database layer | Version: 1.6
(models, ORM) | Resolution: fixed
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"6e5a7367524d3e3abd3d0f60f2e8a41796908101"]:
{{{
#!CommitTicketReference repository=""
revision="6e5a7367524d3e3abd3d0f60f2e8a41796908101"
[1.7.x] Fixed #22514 -- Prevented indexes on virtual fields [postgres].

Backport of 78c32f1caa from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:8>

Django

unread,
Jun 20, 2014, 2:31:36 PM6/20/14
to django-...@googlegroups.com
#22514: Postgres index generator does not expect db_type to be None
-------------------------------------+-------------------------------------
Reporter: vzima | Owner: vzima
Type: Bug | Status: closed
Component: Database layer | Version: 1.6
(models, ORM) | Resolution: fixed
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by vzima):

Found it. It is a regression from 1.5. This is the commit which introduced
the bug:

https://github.com/django/django/commit/c698c55966ed9179828857398d27bf69e64713a2

--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:9>

Django

unread,
Jun 20, 2014, 6:48:02 PM6/20/14
to django-...@googlegroups.com
#22514: Postgres index generator does not expect db_type to be None
-------------------------------------+-------------------------------------
Reporter: vzima | Owner: vzima
Type: Bug | Status: closed
Component: Database layer | Version: 1.6
(models, ORM) | Resolution: fixed
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"1892ced10a8c0a74a93acddecdb3329fc58a017b"]:
{{{
#!CommitTicketReference repository=""
revision="1892ced10a8c0a74a93acddecdb3329fc58a017b"
Added refs #22514 to 1.6.6 release notes.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:10>

Django

unread,
Jun 20, 2014, 7:02:28 PM6/20/14
to django-...@googlegroups.com
#22514: Postgres index generator does not expect db_type to be None
-------------------------------------+-------------------------------------
Reporter: vzima | Owner: vzima
Type: Bug | Status: closed
Component: Database layer | Version: 1.6
(models, ORM) | Resolution: fixed
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"d107c7bd7db183d85bb3b22e0019b3be8af262d2"]:
{{{
#!CommitTicketReference repository=""
revision="d107c7bd7db183d85bb3b22e0019b3be8af262d2"
[1.7.x] Added refs #22514 to 1.6.6 release notes.

Backport of 1892ced10a from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:12>

Django

unread,
Jun 20, 2014, 7:02:29 PM6/20/14
to django-...@googlegroups.com
#22514: Postgres index generator does not expect db_type to be None
-------------------------------------+-------------------------------------
Reporter: vzima | Owner: vzima
Type: Bug | Status: closed
Component: Database layer | Version: 1.6
(models, ORM) | Resolution: fixed
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 1 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"ef3ae3d1c94ac1d4ffaeeeec1ee544e91431e65b"]:
{{{
#!CommitTicketReference repository=""
revision="ef3ae3d1c94ac1d4ffaeeeec1ee544e91431e65b"
[1.6.x] Fixed #22514 -- Prevented indexes on virtual fields [postgres].

Backport of 78c32f1caa from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22514#comment:11>

Reply all
Reply to author
Forward
0 new messages