This type represents a PostgreSQL interval. Intervals can have month, day, and microsecond components. Each component is bounded, so they are not arbitrary precision. For more information about intervals, consult the PostgreSQL documentation: https://www.postgresql.org/docs/17/datatype-datetime.html#DATATYPE-INTERVAL-INPUT.
Note that the time library provides several duration types that are not
appropriate to use as PostgreSQL intervals:
Data.Time.NominalDiffTime: Does not handle days or months. Allows up to picosecond precision. Is not bounded.Data.Time.CalendarDiffTime: Does not handle days. Embeds aNominalDiffTime. Is not bounded.Data.Time.CalendarDiffDays: Does not handle seconds. Is not bounded.
WARNING: The PostgreSQL interval parser is broken in versions prior to 15. It is not possible to round trip all intervals through PostgreSQL on those versions. You should upgrade to at least PostgreSQL version 15. For more information, see this patch: https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=e39f99046
Constructors
Instances7Eq, Show, PersistField, PersistFieldSql, FromField, ToField, …
Eq IntervalDefined in postgresql-simple-interval-1.0.1.2 · Database.PostgreSQL.Simple.Interval.UnstableShow IntervalDefined in postgresql-simple-interval-1.0.1.2 · Database.PostgreSQL.Simple.Interval.UnstablePersistField IntervalDefined in postgresql-simple-interval-1.0.1.2 · Database.PostgreSQL.Simple.Interval.UnstablePersistFieldSql IntervalDefined in postgresql-simple-interval-1.0.1.2 · Database.PostgreSQL.Simple.Interval.UnstableSqlOther "interval"FromField IntervalDefined in postgresql-simple-interval-1.0.1.2 · Database.PostgreSQL.Simple.Interval.UnstableUses parse. Ensures that the OID is intervalOid.
ToField IntervalDefined in postgresql-simple-interval-1.0.1.2 · Database.PostgreSQL.Simple.Interval.UnstableUses render. Always includes an
intervalprefix, likeinterval....Lift IntervalDefined in postgresql-simple-interval-1.0.1.2 · Database.PostgreSQL.Simple.Interval.Unstable