PostgreSQL TSRANGE type
Supported by ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
The TSRANGE
type stores an open or closed interval of TIMESTAMP values, such as [2010-01-01 00:00:00, 2011-01-01 00:00:00)
. jOOQ offers support for this type via a org.jooq.postgres.extensions.types.TimestampRange
or org.jooq.postgres.extensions.types.LocalDateTimeRange
type (depending on the javaTimeTypes code generation flag) that exposes the data structure in form of a set of bounds and flags.
LocalDateTimeRange range = create.fetchValue(T.TSRANGE, T.ID.eq(id)); LocalDateTime lower = range.lower(); LocalDateTime upper = range.upper(); boolean lowerIncluding = range.lowerIncluding(); boolean upperIncluding = range.upperIncluding(); boolean empty = range.isEmpty();
Support for this data type is included in the jooq-postgres-extensions module.
Feedback
Do you have any feedback about this page? We'd love to hear it!