Re: adding times togeather - Mailing list pgsql-general

From Steve Crawford
Subject Re: adding times togeather
Date
Msg-id 20030428231135.2058C103C7@polaris.pinpointresearch.com
Whole thread Raw
In response to Re: adding times togeather  (ed despard <despareg@clarkson.edu>)
List pgsql-general
Ah-ha: you actually have intervals, not times. Make the columns interval data
type.

Cheers,
Steve


On Monday 28 April 2003 3:36 pm, ed despard wrote:
> what i have is two columns that represent the times for sections of a
> race, so i have column A that is say 0:20:23 and i have column B that
> is 0:21:45 and i want to have a column that is A+B where that would be
> 0:42:18 in this case.
>
> ed
>
> On Monday, April 28, 2003, at 06:25  PM, Steve Crawford wrote:
> > I can't tell what you want. Adding two times doesn't make sense. What
> > is
> > 3:15pm + 4:30am or 5:15 April 3 2003 + 4:27 June 14 1997. No such beast
> > exists. I suspect that one of your "times" is really an interval.
> >
> > You can:
> > Subtract two times and get an interval
> > Add an interval to a time to get a time
> > Add two intervals to get an interval
> >
> > What are you trying to do? It might help to tell us what the two
> > columns
> > represent and what the result is supposed to represent.
> >
> > Cheers,
> > Steve
> >
> > On Monday 28 April 2003 3:17 pm, ed despard wrote:
> >> i have two collumns of type time, and i want to get the result of the
> >> two times added togeather. how do i go about doing this? i could use
> >> timestamps instead of times if necessary, but all the date/time
> >> functions seem to want to add intervals to things.
> >>
> >> thanks,
> >> ed
> >>
> >>
> >> ---------------------------(end of
> >> broadcast)---------------------------
> >> TIP 4: Don't 'kill -9' the postmaster
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: timestamps and dates
Next
From: Alvaro Herrera Munoz
Date:
Subject: Re: adding times togeather