TIME vs. TIMESTAMP data type

From: Ludwig Lim <lud_nowhere_man(at)yahoo(dot)com>
To: PostgreSQL Mailing List <pgsql-sql(at)postgresql(dot)org>
Subject: TIME vs. TIMESTAMP data type
Date: 2003-02-06 11:04:35
Message-ID: 20030206110435.27538.qmail@web80303.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Hi:

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

It seems that PostgreSQL (I'm using 7.2.3)
encourage its users to use TIMESTAMP over TIME data
type. I said this because of the following:
a) More functions for DATE and TIMESTAMP data types
such as to_date() and to_timestamp(). Howver, function
to_time() does not exist.
b) Same amount of storage for TIMESTAMP and for
TIME. Time with time zone even need more storage space
than a timestamp (12 bytes vs. 8 bytes).
c) It's harder to TIMESTAMP to TIME and vice versa,
while its easier to cast TIMESTAMP to DATE and vice
versa.

thank you very much,

ludwig

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Ludwig Lim 2003-02-06 11:14:44 Re: Lock timeout detection in postgres 7.3.1
Previous Message betty 2003-02-06 10:10:23 conversi ms-sql7 vs postgresql 7.3