1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #24033 -- Use interval type on Oracle.

Use INTERVAL DAY(9) TO SECOND(6) for Durationfield on Oracle rather than
storing as a NUMBER(19) of microseconds.

There are issues with cx_Oracle which require some extra data
manipulation in the database backend when constructing queries, but it
handles the conversion back to timedelta objects cleanly.

Thanks to Shai for the review.
This commit is contained in:
Marc Tamlyn
2014-12-21 14:36:37 +00:00
parent 803947161b
commit 5ca82e710e
8 changed files with 25 additions and 10 deletions

View File

@@ -60,9 +60,10 @@ New data types
* Django now has a :class:`~django.db.models.DurationField` for storing periods
of time - modeled in Python by :class:`~python:datetime.timedelta`. It is
stored in the native ``interval`` data type on PostgreSQL and as a ``bigint``
of microseconds on other backends. Date and time related arithmetic has also
been improved on all backends. There is a corresponding :class:`form field
stored in the native ``interval`` data type on PostgreSQL, as a ``INTERVAL
DAY(9) TO SECOND(6)`` on Oracle, and as a ``bigint`` of microseconds on other
backends. Date and time related arithmetic has also been improved on all
backends. There is a corresponding :class:`form field
<django.forms.DurationField>`.
Query Expressions