Help Need some hindsight

From: Andreas <maps(dot)on(at)gmx(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Help Need some hindsight
Date: 2010-08-03 02:58:31
Message-ID: 4C5785D7.8040907@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,
I need to display log events (again).
The log is simply like this
log ( log_id serial primary key, create_ts timestamp default
localtimestamp, object_id, state_id, ....... )

It records the state of objects and when and what happend to to change
this state.

I'd like to get a list that shows the current state at any point of time
and the state of the last event before regarding the current object_id.
The tricky bit is that both states should appear in the same row for
every row.

Help?
:)

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Viktor Bojović 2010-08-03 14:38:51 aggregate function
Previous Message John Hasler 2010-08-03 00:03:53 What does PostgreSQL do when time goes backward?