-
-
Notifications
You must be signed in to change notification settings - Fork 505
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
Interval literals with year/months have different number of seconds w.r.t. Python #570
Comments
Not a bug in the sign as I imagined: postgres adds 6 hours every year or every 12 months (but not 3 hours for 6 months or something like that). I think it makes more sense to apply the same conversion, so that Also note that these intervals are pretty specific: they are not obtained by the difference between timestamps, which is always expressed in months. Also, there is no problem of roundtrips because with Python intervals you can't express months and years. |
This is the same operation performed by postgres when extracting the number of seconds of an interval: =# select extract(epoch from '1 year'::interval) / 60 / 60 / 24; ?column? ---------- 365.25 This way `extract(epoch from interval)` will match the resulting `timedelta.total_seconds()`. Close #570
This is the same operation performed by postgres when extracting the number of seconds of an interval: =# select extract(epoch from '1 year'::interval) / 60 / 60 / 24; ?column? ---------- 365.25 This way `extract(epoch from interval)` will match the resulting `timedelta.total_seconds()`. Close #570
This is the same operation performed by postgres when extracting the number of seconds of an interval: =# select extract(epoch from '1 year'::interval) / 60 / 60 / 24; ?column? ---------- 365.25 This way `extract(epoch from interval)` will match the resulting `timedelta.total_seconds()`. Close #570
Not closing now this ticket. This behaviour has been "broken" this way forever (I thought it was broken in the reimplementation for #536). |
select '-1 year -2 mons +3 days -04:05:06'::interval
doesn't return the correct value in PythonThe text was updated successfully, but these errors were encountered: