SELECT ((CAST('2011-01-01' AS DATE) + (months.n * interval '1 month'))::date) beginning_of_month,
((CAST('2011-01-01' AS DATE) + (months.n * interval '1 month' + interval '1 month' - interval '1 day'))::date) end_of_month
FROM GENERATE_SERIES(0,11) months(n)