The epoch from following statement is incorrect,
test_db=# select extract(epoch from age(TIMESTAMP '2013-02-18 06:15:15'));
date_part
-----------
272396685
(1 row)
The correct value should be
test_db=# select (extract(epoch from now()) - extract(epoch from TIMESTAMP '2013-02-18 06:15:15'));
?column?
------------------
272816228.311208
(1 row)
They are several days apart. Maybe leap years are not counted properly?
Postgresql version:
PostgreSQL 11.12 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat
Let me know if you need more information. Thanks!
Zhihong