> > I have checked the FAQ and other sources and learned that the difference
> > between two dates is the integer number of days. I want to know how many
> > years are between those two dates.
thomas=# select age(date 'today', date '1980-01-01'),
thomas-# extract(year from age(date 'today', date '1980-01-01'));
age | date_part
--------------------------+-----------
21 years 11 mons 20 days | 21
Is this close to what you want? The nice thing about the age() function
is that it preserves the qualitative units of month and year.
- Thomas