#20446 closed Cleanup/optimization (fixed)
Documentation for SmallIntegerField does not clarify 'small'
| Reported by: | Sasha Romijn | Owned by: | nobody |
|---|---|---|---|
| Component: | Documentation | Version: | dev |
| Severity: | Normal | Keywords: | dceu13 |
| Cc: | eromijn@… | Triage Stage: | Ready for checkin |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
The documentation for SmallIntegerField and PositiveSmallIntegerField simply state the range is 'database-dependant'. Although true, this is rather useless to someone trying to decide whether to use this field.
I have looked at this and found:
| Database | Datatype | Min value | Max value |
| SQLite | INTEGER | Same as IntegerField | Same as IntegerField
|
| Oracle | NUMBER(11) | Same as IntegerField | Same as IntegerField
|
| MySQL for SmallIntegerField | smallint | -32768 | 32767 |
| MySQL for PositiveSmallIntegerField | smallint unsigned | 0 | 65535 |
| PostgreSQL | smallint | -32768 | 32767 |
Therefore, I think the documentation should state a safe range of -32768 to 32767 for all databases.
Change History (5)
comment:1 by , 12 years ago
| Easy pickings: | set |
|---|---|
| Has patch: | set |
comment:3 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Pull request in https://github.com/django/django/pull/1128