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

Fix interval overflow #1658

Merged
merged 1 commit into from Dec 21, 2019
Merged

Fix interval overflow #1658

merged 1 commit into from Dec 21, 2019

Conversation

reibitto
Copy link
Contributor

I noticed issues with interval after upgrading to 42.2.9 from 42.2.8. It appears #1612 is the cause due to overloading issues. Some of the units were changed from int to byte. But I don't believe this is sound because intervals in postgres aren't guaranteed to be justified. For example, it's valid to have hour values greater than 24 hours:

select interval '900 hours';
-- 0 years 0 mons 0 days 900 hours 0 mins 0.00 secs

select justify_interval(interval '900 hours');
-- 0 years 1 mons 7 days 12 hours 0 mins 0.00 secs

I have unjustified intervals in my DB which is how I discovered this.

@davecramer
Copy link
Member

Thanks, I was never truly happy with this change

@davecramer davecramer merged commit a44ab4b into pgjdbc:master Dec 21, 2019
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.

None yet

2 participants