Обсуждение: Entering time into postgresql

Поиск
Список
Период
Сортировка

Entering time into postgresql

От
BlackMage
Дата:
Is there a field that can actually store time in PostgreSql. And what I mean
by time is not like time of the day, but a specific amount of time.

The application I am developing records how long it takes for a user to do a
task, say 5 minutes and 32 seconds. That time is entered into the database
so latter it can be sorta like: "SELECT * FROM user_time WHERE
time_taken<6:00".

Thanks in advance.
--
View this message in context: http://www.nabble.com/Entering-time-into-postgresql-tp23925803p23925803.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


Re: Entering time into postgresql

От
David Wilson
Дата:
On Mon, Jun 8, 2009 at 11:04 AM, BlackMage <dsd7872@uncw.edu> wrote:

> Is there a field that can actually store time in PostgreSql. And what I mean
> by time is not like time of the day, but a specific amount of time.

The manual is your friend:
http://www.postgresql.org/docs/8.3/static/datatype-datetime.html

The interval data type is what you're looking for.

--
- David T. Wilson
david.t.wilson@gmail.com

Re: Entering time into postgresql

От
Vick Khera
Дата:
On Mon, Jun 8, 2009 at 11:04 AM, BlackMage<dsd7872@uncw.edu> wrote:
>
> Is there a field that can actually store time in PostgreSql. And what I mean
> by time is not like time of the day, but a specific amount of time.

This is known as type "INTERVAL" to postgres.