Difference between EXTRACT(year from timestamp) function and date_part('year', timestamp) in PostgreSQL
<p>I am using PostreSQl server and have to get data grouped by date part of timestamp (ie. group by month or year or week) so I am using the <code>Extract(year from timestamp)</code> function but I saw in the Postgresql documentation that there is a function <code>date_part('year',timestamp)</code> too which can do the same. Here I confused which function I have to use and which function will be efficient. Also please tell me if there is another good way to get data groped by date part.</p>