Implementation and test of ByTimeRange for PostgresStorage