Today I Learned

hashrocket A Hashrocket project

Intervals Of Time By Week

It is pretty common to use hours or days when creating a Postgres interval. However, intervals can also be created in week-sized chunks

> select '2 weeks'::interval;
 14 days
(1 row)

> select make_interval(0,0,7,0,0,0,0);
 49 days
(1 row)
See More #sql TILs
Looking for help? Hashrocket developers believe that data quality is as important as code quality. We enjoy all the challenges of relational databases, from finding the fastest index, to structuring data to fit the needs of an application. We're eager to share our experiences; check out PG Casts, our series of free PostgreSQL screencasts.