... and if you want to ditch the function call, you can try something
like this:
lockhart=# select *, (select sum(e-b) from t1 where b <= x.b) from t1 x;
i | b | e | ?column?
---+------------------------+------------------------+----------
1 | 2002-02-05 17:14:37+00 | 2002-02-05 17:14:38+00 | 00:00:01
1 | 2002-02-05 17:14:40+00 | 2002-02-05 17:14:41+00 | 00:00:02
1 | 2002-02-05 17:14:41+00 | 2002-02-05 17:14:42+00 | 00:00:03
1 | 2002-02-05 17:14:42+00 | 2002-02-05 17:14:43+00 | 00:00:04
(4 rows)