how to calculate differences of timestamps? - Mailing list pgsql-sql

From Andreas
Subject how to calculate differences of timestamps?
Date
Msg-id 4E812787.1080002@gmx.net
Whole thread Raw
Responses Re: how to calculate differences of timestamps?
List pgsql-sql
How could I calculate differences of timestamps in a log-table?

Table log ( user_id integer, login boolean, ts timestamp )

So login = true would be a login-event and login = false a logout.
Is there a way to find the matching login/logout to calculate the 
difference?

Or is there a better table "design" to do this?


pgsql-sql by date:

Previous
From: Filip Rembiałkowski
Date:
Subject: Re: handling duplicate row exception
Next
From: Tim Landscheidt
Date:
Subject: Re: how to calculate differences of timestamps?