fix courses postgres time slicing