Skip to content

support negative intervals and >24h#25

Open
eratio08 wants to merge 1 commit intotsloughter:mainfrom
eratio08:fix/interval-signed-arithmetic
Open

support negative intervals and >24h#25
eratio08 wants to merge 1 commit intotsloughter:mainfrom
eratio08:fix/interval-signed-arithmetic

Conversation

@eratio08
Copy link
Copy Markdown

@eratio08 eratio08 commented Mar 4, 2026

Fix/Feature (not sure) to support 25h (e,g, due to dst) and negative intervals which are valid intervals in postgres. Postgres does not normalize hours >24 into days, so even intervals with 100h are valid.

original pr: #24

@eratio08 eratio08 marked this pull request as ready for review March 9, 2026 16:17
@eratio08
Copy link
Copy Markdown
Author

will fix the build asap

Intervals with >=24 hours or negative microseconds crashed with
function_clause in calendar:seconds_to_time/1 which only accepts
0-86399. Replace the call to pg_time:decode_time/1 with a local
decode_interval_time/1 that uses signed div/rem, correctly handling
negative values, values exceeding 24 hours, and fractional seconds.
@eratio08 eratio08 force-pushed the fix/interval-signed-arithmetic branch from 840f5d6 to 63d3a79 Compare March 28, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant