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:

  1. Add support for parsing PostgreSQL's infinity and -infinity values into Django models.
  2. Represent infinity and -infinity using custom Python objects or constants (e.g., django.db.utils.Infinity and -Infinity).
  3. Ensure seamless integration with Django's ORM for querying, inserting, and updating fields containing these values.
  4. Provide a mechanism to serialize and deserialize these values (e.g., JSON serialization).

Use Cases:

  1. Handling open-ended event durations.
  2. Representing date ranges without a start or end boundary.
  3. Supporting applications that already use these values in their PostgreSQL databases.

Benefits:

  1. Enables Django developers to work with PostgreSQL databases more effectively.
  2. Expands Django's compatibility with PostgreSQL's advanced features.

Potential Challenges:

  1. Ensuring backward compatibility with existing applications.
  2. 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)

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top