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

Add support for PG 17 interval infinity values #2065

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

toofishes
Copy link

Although Postgres 17 is still in beta, I thought it might make sense to get ahead of one of the changes being made.

Added in this commit: postgres/postgres@519fc1bd9
Upstream release notes: https://www.postgresql.org/docs/17/release-17.html#RELEASE-17-DATATYPES

The wire format for infinity/-infinity adds no breaking changes- it is just the various values set to either minimum or maximum possible int64/int32 values.

I attempted to match how InfinityModifier works in other types, such as date and timestamptz.

Please let me know what, if anything, I forgot to update here, and any other feedback is definitely welcome.

It feels like this is relatively safe and backward compatible with older versions, since you can just choose not to use infinity values with older versions, and since there were no wire format changes. However, I'm happy to make changes or documentation updates if that is necessary.

Added in this commit: postgres/postgres@519fc1bd9

The wire format for infinity/-infinity adds no breaking changes- it is just the
various values set to either minimum or maximum possible int64/int32 values.

I attempted to match how InfinityModifier works in other types, such as date
and timestamptz.
Microseconds int64
Days int32
Months int32
InfinityModifier InfinityModifier
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth adding a field comment here along the lines of this?

// InfinityModifier for intervals is only supported in Postgres 17 or newer
InfinityModifier InfinityModifier

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't hurt.

Microseconds int64
Days int32
Months int32
InfinityModifier InfinityModifier
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't hurt.

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.

2 participants