Even if extracting fields from a date would always produce results that could fit in an integer, according to the doc, extract
doesn't directly work on a date
type:
The extract function retrieves subfields such as year or hour from
date/time values. source must be a value expression of type
timestamp, time, or interval. (Expressions of type date are cast to timestamp and can therefore be used as well.)
So extract(date...)
does not exist as such, rather it's extract(timestamp...)
with an implicit cast of the argument, and extract(timestamp...)
can't return only integers, for instance extract(seconds from timestamp)
has a fractional part.
In addition to that, extract(epoch from date)
doesn't fit in a postgres integer for dates beyond the 19 January 2038
(see The Year 2038 problem), which will be become a real problem as we progress towards that date.