Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psycopg2 is in maintenance mode and psycopg 3.x does not support ±infinity #3190

Open
hmpf opened this issue Nov 12, 2024 · 0 comments
Open
Labels
dependencies Pull requests that update a dependency file django postgresql python Pull requests that update Python code sql

Comments

@hmpf
Copy link
Contributor

hmpf commented Nov 12, 2024

NAV uses ±infinity for several datetime fields. It makes for elegant comparisons and is indexable.

Sooner or later we will have to switch away from psycopg2 to psycopg 3.x, it might be as early as for Python 3.13/Django 5.1 (Uninett/Argus#942). As of today, psycopg 3.x does NOT support ±infinity.

We could write our own database backend that uses psycopg 3.x and psycopg-infdate or we could wait and hope that psycopg 3.x adds support.

Currently, testing on psycopg 3.x should yield django.db.utils.DataError: timestamp too large (after year 10K): 'infinity'.

@hmpf hmpf added postgresql sql dependencies Pull requests that update a dependency file python Pull requests that update Python code django labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file django postgresql python Pull requests that update Python code sql
Projects
None yet
Development

No branches or pull requests

1 participant