Re: Inserting Values into Interval - Mailing list pgsql-general

From Jasen Betts
Subject Re: Inserting Values into Interval
Date
Msg-id h1t6gf$sde$3@reversiblemaps.ath.cx
Whole thread Raw
In response to Inserting Values into Interval  (BlackMage <dsd7872@uncw.edu>)
List pgsql-general
On 2009-06-23, BlackMage <dsd7872@uncw.edu> wrote:

>
> Well what format should be used then?
>
> The application works like this. Users use a watch time how fast they run
> from point A to point B. Afterwards they enter the time taken, say 5 minutes
> 39 seconds, into a field. The field already checks to make sure the time is
> entered in the correct format. After that it takes the time entered in that
> fields an enters it into a the db.
>
> So what other field would you enter this into in the db?

postgres likes 00:05:39  and 5m39s
it also accepts 5m39 and 0:5:39

so if you can translate the user entered ':' to an 'm' or
prepend a '0:' to their input you should get the result you desire.

another option may be to divide the interval by 60 :)


00:05:39 is how it will represent the value normally.


On the other hand, could you train them to use 'm' instead of ':' ?



pgsql-general by date:

Previous
From: Marko Pahić
Date:
Subject: A question about inheritance and sequence
Next
From: CM J
Date:
Subject: Postgres 8.3.7 -- EOF on client connection