Opened 7 days ago
Last modified 7 days ago
#36045 closed New feature
Add Support for PostgreSQL Infinity and -Infinity in Date/Time Fields — at Initial Version
Reported by: | Kavin Bharathi | Owned by: | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 5.1 |
Severity: | Normal | Keywords: | postgres, infinity, datetime |
Cc: | Kavin Bharathi | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Proposed Feature:
- Add support for parsing PostgreSQL's infinity and -infinity values into Django models.
- Represent infinity and -infinity using custom Python objects or constants (e.g., django.db.utils.Infinity and -Infinity).
- Ensure seamless integration with Django's ORM for querying, inserting, and updating fields containing these values.
- Provide a mechanism to serialize and deserialize these values (e.g., JSON serialization).
Use Cases:
- Handling open-ended event durations.
- Representing date ranges without a start or end boundary.
- Supporting applications that already use these values in their PostgreSQL databases.
Benefits:
- Enables Django developers to work with PostgreSQL databases more effectively.
- Expands Django's compatibility with PostgreSQL's advanced features.
Potential Challenges:
- Ensuring backward compatibility with existing applications.
- Deciding on a Python representation for infinity that integrates well with Django's ORM and other Python libraries.
References:
[PostgreSQL Documentation on Infinity](https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME-SPECIAL-VALUES)
Note:
See TracTickets
for help on using tickets.