How to generate 52 weeks from current date using postgresql
for example: from current_date(i.e todays date) to 52 weeks .
You can use generate_series which allows you to define range (start, stop) as well as the step interval like: generate_series(startDate, endDate, stepBy) so depending on output format you are after you could do something like:
SELECT generate_series(
current_date,
current_date + interval '52 weeks',
interval '1 week'
) weeks;
which would generate something like this:
weeks
2017-05-24 00:00:00
2017-05-31 00:00:00
2017-06-07 00:00:00
...