Generate all years between two timestamps As part of a larger Postgres query, I generate all years between two given timestamps (timestamptz):