X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 383D6474E44 for ; Thu, 6 Feb 2003 07:00:53 -0500 (EST) Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by postgresql.org (Postfix) with ESMTP id 4C76B474E42 for ; Thu, 6 Feb 2003 07:00:52 -0500 (EST) Received: from klaster.net (pe103.krakow.cvx.ppp.tpnet.pl [213.76.40.103]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 5365B2B883; Thu, 6 Feb 2003 12:21:46 +0100 (CET) Message-ID: <3E42481C.6050705@klaster.net> Date: Thu, 06 Feb 2003 12:33:48 +0100 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; PL; rv:1.1) Gecko/20020826 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: Ludwig Lim Cc: PostgreSQL Mailing List Subject: Re: TIME vs. TIMESTAMP data type References: <20030206110435.27538.qmail@web80303.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/112 X-Sequence-Number: 11510 Ludwig Lim wrote: > 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 Probably you are right, but you can cast into timestamp before using these functions. Do you really need to care amount of storage? Don't forget about INTERVAL type, which is very useful for time calculations. Regards, Tomasz Myrta