Re: Timestamp vs. Interval and formatting.... - Mailing list pgsql-novice

From Michael Glaesemann
Subject Re: Timestamp vs. Interval and formatting....
Date
Msg-id 52822CCE-3F46-11D8-BA4F-000A95C88220@myrealbox.com
Whole thread Raw
In response to Re: Timestamp vs. Interval and formatting....  (Dan Jewett <dan@thenormalfamily.net>)
Responses Re: Timestamp vs. Interval and formatting....  (Michael Glaesemann <grzm@myrealbox.com>)
List pgsql-novice
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);

I'm not sure about the casts as they are, but there should be a way to
do that. There was just a post that had a subquery used to get a value
on a update, so I'm not sure that'd work either, but might be worth a
shot.

FWIW,

Michael Glaesemann
grzm myrealbox com


pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: multiline PL/Python function fails in *.sql
Next
From: Michael Glaesemann
Date:
Subject: Re: Timestamp vs. Interval and formatting....