I have the following query that generates list of months for given year when input is date (2014-01-01):
SELECT to_char(dd, 'Month')
FROM generate_series(CAST('2014-01-01' AS DATE), date_trunc('month', now()), '1 month') as dd;
to_char
-----------
January
February
(2 rows)
Now, instead of 2014-01-01 I need to pass only 2014 and get the same result.