Gary Chambers wrote:
D'Arcy...

Have you considered this?

I considered integrating the begin and end times into the table.  I'm
capturing the data via ACPI events, so it's "transactional" by nature.
I want to be able to keep track of false transitions (hence the
is_outage field).

I'm looking for a way to simplify the transitions output on my web
browser, and I want to combine an offline and a corresponding online
time into a single line.

How about a "paired_with" field that references the power_transitions table and a trigger. When you insert a new row, it checks what the previous row was - if it's a down & this is an up, then set the paired_with field on each.

--
  Richard Huxton
  Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

              http://www.postgresql.org/docs/faq

Reply via email to