Skip to content

Infinite dates handling: Better solution #283

Description

@guettli

Better handling of infinite date handling:

Current state:
http://initd.org/psycopg/docs/usage.html#infinite-dates-handling
{{{
PostgreSQL can store the representation of an “infinite” date, timestamp, or interval. Infinite dates are not available to Python, so these objects are mapped to date.max, datetime.max, interval.max. Unfortunately the mapping cannot be bidirectional so these dates will be stored back into the database with their values, such as 9999-12-31.
}}}

It would be very good to have a better solution.

Feature Request: Support the special values from postgres:

  • infinity
  • - infinity

Related: http://www.postgresql.org/docs/current/static/datatype-datetime.html#AEN6027

I know that Python does not support infinty in the datetime module.

Maybe psycopg could use a custom subclass of date/datetime/timedelta?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions