|
|
|
|
|
by orf
3304 days ago
|
|
You cannot have a post entitled "Working with time in Postgres" and fail to mention Range Types[1]! If you're using Postgres right now and have any columns like start_* and end_* for anything (e.g numbers or dates), you need to stop what you are doing and use a range type. They are amazing. You can do things like a unique index that ensures there are no overlapping ranges, you can do efficient inclusion/exclusion indexing and much more. Use them. I'm always surprised more people don't know about them. 1. https://www.postgresql.org/docs/9.6/static/rangetypes.html |
|
[1] http://www.craigkerstiens.com/2017/04/30/why-postgres-five-y...