On this day every year I get curious about how old I actually am. Postgres has some utilities to help me out with that, like subtraction of dates.
> select now() - '1978-3-24'; 14245 days 17:39:55.623866
Ah yes, 14245 days on this earth, it really makes you think. What got returned anyways, that looks weird:
> select pg_typeof(now() - '1978-3-24'); interval
Got it, that’s an interval. It doesn’t really tell me much, is this interval infinite?
> select isfinite(now() - '1978-3-24'); t
I can squint and read isfinite as infinite and suddenly my outlook changes, but only momentarily.
Postgres, just tell me how many years I’ve been alive ok? None of this days stuff.
> select age('1978-3-24'::date); 39 years