-
-
Notifications
You must be signed in to change notification settings - Fork 219
Closed
Description
It seems there's a bug within psycopg-binary IntervalLoader implementation, this however can't be reproduced using the python version of IntervalLoader.
To reproduce the issue:
pip install psycopg
import psycopg
conn = psycopg.connect(user='postgres', password='postgres', dbname='postgres')
with conn.cursor() as cur:
cur.execute("select ('1993534:40:40.447')::interval")
row=cur.fetchone()
print(row)output from the above code: ✅
(datetime.timedelta(days=83063, seconds=81640, microseconds=447000),)
now pip install psycopg-binary and run the code again, it outputs: ❌
(datetime.timedelta(days=-16357, seconds=35048, microseconds=447000),)
It seems regular int is overflowing so long must be used for seconds, here's a rough patch
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels