Re: sum(time) problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Julian Scarfe <julian(dot)scarfe(at)ntlworld(dot)com>
Cc: Oliver Vecernik <vecernik(at)aon(dot)at>, pgsql-sql(at)postgresql(dot)org
Subject: Re: sum(time) problem
Date: 2003-01-17 15:03:04
Message-ID: 11792.1042815784@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Julian Scarfe <julian(dot)scarfe(at)ntlworld(dot)com> writes:
>> It seems I've chosen the wrong type. Or is there another solution?

> Correct diagnosis. You need the "interval" type, not the "time" type for
> your second field. Interval is a time difference between two timestamps,
> for example the time between the start and the finish of a race.

Right. "time" is intended for time-of-day values; so taking the sum
would be a nonsensical operation.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message dev 2003-01-17 15:05:27 RCF: 2nd draft: A brief guide to Nulls
Previous Message Julian Scarfe 2003-01-17 13:13:31 Re: sum(time) problem