1st option
date_trunc('month', timestamp_column)::date
It will support date format with all months starting from the first day.
Example:
2016-08-01 2016-09-01 2016-10-01 2016-11-01 2016-12-01 2017-01-01
Second option
to_char(timestamp_column, 'YYYY-MM')
This solution suggested by @yairchu worked fine in my case. I really wanted to give up information about the "day."
Luis Martins Nov 14 '17 at 19:39 2017-11-14 19:39
source share