postgresql extract(year from date) code example
Example 1: get year from date postgres
SELECT EXTRACT(YEAR FROM column_date);
Example 2: postgres extract day from date
SELECT EXTRACT(DAY FROM TIMESTAMP '2016-12-31 13:30:15');Code language: PostgreSQL SQL dialect and PL/pgSQL (pgsql)