merge timestamps to intervals - Mailing list pgsql-sql

From Patrick Scharrenberg
Subject merge timestamps to intervals
Date
Msg-id 4827D7E7.6000702@web.de
Whole thread Raw
Responses Re: merge timestamps to intervals
Re: merge timestamps to intervals
List pgsql-sql
Hi!

I have a table where I repeatingly log the status of some service, which
looks something like this:
< timestamp, status >

Now, everytime my service is up I save the timestamp and a status of
"up", if it's down I save the timestamp with "down", eg:10:13    up10:14    up10:15    up10:16    down10:17    up10:18
 up
 

I'd like to merge this information to intervals where the service was up
or down.
< intervall, status >10:13-10:15    up10:16-10:16    down10:17-1018    up

I've no clue how to approach this problem.

Any ideas/hints?
Also suggestions on a feasible better schema are welcome. :-)

Thanks
Patrick


pgsql-sql by date:

Previous
From: "Mag Gam"
Date:
Subject: Re: Difference in columns
Next
From: Craig Ringer
Date:
Subject: Re: merge timestamps to intervals