Skip to content

Add interval type#157

Closed
tfausak wants to merge 1 commit intohaskellari:masterfrom
tfausak:gh-59-interval
Closed

Add interval type#157
tfausak wants to merge 1 commit intohaskellari:masterfrom
tfausak:gh-59-interval

Conversation

@tfausak
Copy link

@tfausak tfausak commented Jun 26, 2025

Related issues and PRs:

This PR introduces a custom Interval type because the duration types provided by the time library do not match the interval type in Postgres (months :: Int32, days :: Int32, microseconds :: Int64):

  • DiffTime: not appropriate
  • NominalDiffTime: only handles seconds (not days or months), allows picosecond precision (rather than micro), allows arbitrarily large durations
  • CalendarDiffTime: does not separate days from months
  • CalendarDiffDays: does not handle seconds

Unlike the existing FromField instance for CalendarDiffTime, this does not require a particular intervalstyle to be set in Postgres.

Loading
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