You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PostgreSQL stores INTERVAL columns with separate years and months, however, psycopg2 converts these to days, as Python's timedelta doesn't support years and months.
However, sometimes it might be desirable to get the months and years originally stored in the PostgreSQL column, as the length of a months and year depends on the start date. psycopg2 should also provide an interface to simply return the column value as a string in iso_8601 output style, instead of converting to timedelta, so it can be further processed by packages like isodate.
The text was updated successfully, but these errors were encountered:
Hey,
PostgreSQL stores
INTERVAL
columns with separate years and months, however, psycopg2 converts these to days, as Python'stimedelta
doesn't support years and months.However, sometimes it might be desirable to get the months and years originally stored in the PostgreSQL column, as the length of a months and year depends on the start date. psycopg2 should also provide an interface to simply return the column value as a string in iso_8601 output style, instead of converting to
timedelta
, so it can be further processed by packages like isodate.The text was updated successfully, but these errors were encountered: