Some PL/pgSQL functions that facilitate lazily materializing views on an interval. A couple of psql scripts to load the functions and test them.