Re: TIME vs. TIMESTAMP data type

From: Julian Scarfe <julian(dot)scarfe(at)ntlworld(dot)com>
To: Ludwig Lim <lud_nowhere_man(at)yahoo(dot)com>, PostgreSQL Mailing List <pgsql-sql(at)postgresql(dot)org>
Subject: Re: TIME vs. TIMESTAMP data type
Date: 2003-02-06 12:17:31
Message-ID: BA6802DB.216F5%julian.scarfe@ntlworld.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 6/2/03 11:04, "Ludwig Lim" <lud_nowhere_man(at)yahoo(dot)com> wrote:

> Are there cases when a TIME data type is a better
> choice over the TIMESTAMP data type?

Surely this depends on the nature of the data that you want to represent?

If you're researching into sleep patterns and want to represent the times
each day that subjects say they tend to wake and/or fall asleep, you may
want the TIME type, as the important aspect is the time, not the date. The
inclusion of a date would be nonsensical.

If you want to record *when* an event occurred, you usually want date and
time, so TIMESTAMP is more appropriate.

Since event timing is a much more frequent requirement than a time-of-day,
it's not surprising that the facilities may be better developed for dealing
with that type.

Julian Scarfe

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tomasz Myrta 2003-02-06 13:49:40 Re: Trigger para fazer log
Previous Message Christoph Haller 2003-02-06 12:12:29 Re: Lock timeout detection in postgres 7.3.1