Answers:
select age(timestamp_A, timestamp_B)
回答伊戈尔的评论:
select age('2013-02-28 11:01:28'::timestamp, '2011-12-31 11:00'::timestamp);
age
-------------------------------
1 year 1 mon 28 days 00:01:28
Subtract arguments, producing a "symbolic" result that uses years and months
。它不会在几秒钟内给出差异。
to get the difference between these timestamps in seconds
。并且it should include hours, minutes etc
意味着它必须是完全一样的10:25:30 - 10:15:25 = 605 seconds
。我的猜测-他用过EXTRACT(SECONDS FROM ...)
并得到了10:25:30 - 10:15:25 = 5 seconds