Re: Timestamp vs. Interval and formatting....

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: Michael Glaesemann <grzm(at)myrealbox(dot)com>
Cc: Dan Jewett <dan(at)thenormalfamily(dot)net>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Timestamp vs. Interval and formatting....
Date: 2004-01-05 06:22:32
Message-ID: 8B9E7CD5-3F47-11D8-BA4F-000A95C88220@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


On Jan 5, 2004, at 12:13 AM, Michael Glaesemann wrote:

> Hi Dan,
>
> On Jan 4, 2004, at 7:30 PM, Dan Jewett wrote:
>
>> On Sun, 4 Jan 2004 14:47:49 -0600, Michael Glaesemann wrote this well
>> considered message:
>
> You certainly know how to flatter a guy! :)
>
>> Now I just have the issue of resetting all those times I already
>> entered which were HH:MM instead of MM:SS.
>
> This is just thinking out loud: I haven't tried it. Can you do
> something like this?
>
> UPDATE track_length SET length = (
> SELECT EXTRACT(hour FROM length)::min + EXTRACT(min FROM length)::sec
> FROM track_length);

On second thought, I think this SELECT isn't specific enough. This
should be better:

UPDATE track_length
SET length = (EXTRACT(hour FROM length)::min + EXTRACT(min FROM
LENGTH)::sec)

Still not sure of the casts, but I think it's closer.

Michael Glaesemann
grzm myrealbox com

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message gavaneh 2004-01-05 11:01:24 postgresql in windows
Previous Message Michael Glaesemann 2004-01-05 06:13:47 Re: Timestamp vs. Interval and formatting....