select date_part('days', date_trunc('month', '2016-02-12'::timestamp) + '1 month'::interval - date_trunc('month', '2016-02-12'::timestamp));
select date_part('days', date_trunc('month', '2016-02-12'::timestamp) + '1 month'::interval - '1 day'::interval);