Puoi usare la funzione date_part()

The date_part function is modeled on the traditional Ingres equivalent to the SQL-standard function extract:

date_part('field', source) Note that here the field parameter needs to be a string value, not a name. The valid field names for date_part are the same as for extract.

SELECT date_part('day', TIMESTAMP '2001-02-16 20:38:40');
Result: 16


Immagino sarà sufficiente utilizzare 'year' e 'month' ...