top | item 34204537

(no title)

ivank | 3 years ago

https://github.com/xocolatl/periods periods does this for PostgreSQL.

discuss

order

ttfkam|3 years ago

Great solution. Unfortunately only works on installations that support extensions, which excludes most managed database services like AWS RDS.

I like how you tried to track the standard as close as possible. I've seen (and written) ad hoc solutions that hard-code too much or mandate certain columns to be present.

That said, unlike the standard and most other RDBMSs, Postgres supports range types. Seems a shame to rely simply on two timestamptz columns when one tstzrange should suffice.