遍历两个日期的每一天
select * from generate_series('2019-09-01 00:00:00'::TIMESTAMP, '2019-10-01 00:00:00'::TIMESTAMP, '1 day');
输出结果:
遍历两个日期的每小时
select * from generate_series('2019-09-01 00:00:00'::TIMESTAMP, '2019-10-01 00:00:00'::TIMESTAMP, '1 hour');
输出结果: