#24632: PostgreSQL table inheritance
-------------------------+-------------------------------------------------
Reporter: | Owner:
yennicks |
Type: New | Status: new
feature |
Component: | Version: master
contrib.postgres | Keywords: orm postgresql table-inheritance
Severity: Normal | inheritance object-relational
Triage Stage: | Has patch: 0
Unreviewed |
Easy pickings: 0 | UI/UX: 0
-------------------------+-------------------------------------------------
The Django ORM multi-table inheritance approach works by creating a
different table for every subclass. For working with these subclasses the
ORM uses SQL table joins to query the database. This makes sense for
databases such as MySQL and SQLite but not for PostgreSQL.
I suggest adding a PostgreSQL specific model that optimizes the ORM
behaviour when developing for a PostgreSQL database. This allows for using
the PostgreSQL object-relational table approach by the ORM. When
implemented, a table used by a subclass inherits from the table used by
the superclass, avoiding for example the usage of joins.
Another approach is optimizing the default behaviour of the Django ORM but
this might impact existing Django implementations that expect traditional
multi-table inheritance.
PostgreSQL 9.4 manual about table inheritance:
http://www.postgresql.org/docs/9.4/static/ddl-inherit.html
--
Ticket URL: <https://code.djangoproject.com/ticket/24632>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/051.9babc82964d7065d883778bcb8a664d1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.