[Django] #24920: Database type NUMERIC with no parameters is not supported

9 views
Skip to first unread message

Django

unread,
Jun 4, 2015, 7:06:35 AM6/4/15
to django-...@googlegroups.com
#24920: Database type NUMERIC with no parameters is not supported
-------------------------------------+-------------------------------------
Reporter: shaib | Owner: nobody
Type: New | Status: new
feature |
Component: Database | Version: master
layer (models, ORM) |
Severity: Normal | Keywords: oracle
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 1 | Needs tests: 1
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
Django's `DecimalField` requires both `max_digits` and `decimal_places`.
Database backends allow them to be dropped, to specify an "unlimited
precision" field.

This leads to bugs in `inspectdb`: On Oracle, a column defined as
`NUMERIC` is inspected as having 0 digits and negative precision; on
Postgresql, it is inspected as having 65535 (a C short -1?) digits and
decimal places, when the [http://www.postgresql.org/docs/9.4/static
/datatype-numeric.html documentation] says you can only explicitly define
up to 1000 decimal places (and even the implicitly defined precision is
only 16383).

Discussion in the context of Oracle (from 2012):
https://groups.google.com/d/topic/django-developers/qSAfzPyqKqw/discussion

(This could be solved more easily by adding a new field type than by
modifying the behavior of the existing `DecimalField`; however, I'm having
a hard time suggesting a name for such a field type, which may be an
indication that it is a bad interface. Besides that decision, this
probably applies as an easy picking).

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

Django

unread,
Jun 9, 2015, 2:23:01 PM6/9/15
to django-...@googlegroups.com
#24920: Database type NUMERIC with no parameters is not supported
-------------------------------------+-------------------------------------
Reporter: shaib | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: oracle | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* needs_docs: 1 => 0
* needs_tests: 1 => 0
* easy: 1 => 0
* stage: Unreviewed => Accepted


Comment:

Maybe you could raise the idea on the DevelopersMailingList. I think I'd
prefer if we didn't need to add a new field, but if so, I'll propose the
name `ImpreciseDecimalField`. Seems like a name like that might scare
people away from using it though.

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

Django

unread,
Mar 24, 2017, 1:39:40 PM3/24/17
to django-...@googlegroups.com
#24920: Database type NUMERIC with no parameters is not supported
-------------------------------------+-------------------------------------
Reporter: Shai Berger | Owner: nobody

Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: oracle | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Maciej Gol):

Any update on this or a suggested way of resolving: either new field or a
fix to `DecimalField`?

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

Django

unread,
Mar 24, 2017, 8:07:29 PM3/24/17
to django-...@googlegroups.com
#24920: Database type NUMERIC with no parameters is not supported
-------------------------------------+-------------------------------------
Reporter: Shai Berger | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: oracle | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

If you want to propose a solution, please write to the
DevelopersMailingList to get feedback about how to proceed.

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

Django

unread,
Oct 20, 2025, 6:31:19 PM (2 days ago) Oct 20
to django-...@googlegroups.com
#24920: Database type NUMERIC with no parameters is not supported
-------------------------------------+-------------------------------------
Reporter: Shai Berger | Owner: nobody
Type: New feature | Status: new
Component: Database layer | Version: dev
(models, ORM) |
Severity: Normal | Resolution:
Keywords: oracle | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Tim Graham):

On the [https://groups.google.com/g/django-
developers/c/6BFfYDs53_k/m/HGw1vgs7fDIJ django-developers thread], Aymeric
proposed trying to adapt `DecimalField` rather than introduce a new field,
and Claude gave that idea a +1.

#36673 is a duplicate that requests making `DecimalField`'s `max_digits`
and `decimal_places` optional.
--
Ticket URL: <https://code.djangoproject.com/ticket/24920#comment:4>
Reply all
Reply to author
Forward
0 new messages