Re: Inserting Values into Interval

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Inserting Values into Interval
Date: 2009-06-24 12:34:23
Message-ID: h1t6gf$sde$3@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2009-06-23, BlackMage <dsd7872(at)uncw(dot)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 ':' ?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message CM J 2009-06-24 12:36:39 Postgres 8.3.7 -- EOF on client connection
Previous Message Marko Pahić 2009-06-24 11:43:20 A question about inheritance and sequence