X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7DAF347634E for ; Fri, 2 May 2003 11:05:11 -0400 (EDT) Received: from rtlocal.trade-india.com (mail-relay.trade-india.com [203.196.129.235]) by postgresql.org (Postfix) with SMTP id DE4C94762CF for ; Fri, 2 May 2003 11:05:05 -0400 (EDT) Received: (qmail 27164 invoked from network); 2 May 2003 15:06:08 -0000 Received: from unknown (HELO system67.trade-india-local.com) (unknown) by unknown with SMTP; 2 May 2003 15:06:08 -0000 From: Rajesh Kumar Mallah Organization: Infocom Network Limited To: Tom Lane Subject: Re: timeofday() and now() issue.. Date: Fri, 2 May 2003 20:37:09 +0530 User-Agent: KMail/1.5 Cc: pgsql-sql@postgresql.org References: <200305021844.35194.mallah@trade-india.com> <10505.1051887437@sss.pgh.pa.us> In-Reply-To: <10505.1051887437@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200305022037.09625.mallah@trade-india.com> X-Spam-Status: No, hits=-33.1 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT, REFERENCES,REPLY_WITH_QUOTES,SIGNATURE_SHORT_SPARSE, USER_AGENT autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/26 X-Sequence-Number: 13191 On Friday 02 May 2003 8:27 pm, Tom Lane wrote: > Rajesh Kumar Mallah writes: > > SELECT CAST (timeofday() as timestamp with time zone) - CAST (now() as > > timestamp with time zone); shudn't it return something close to 0 ? > > Works for me ... what's your platform, PG version, and timezone? > And what are you getting from the intermediate steps in that expression? > > regards, tom lane Dunno if details given below would suffice, please lemme know if you want anything specific Regds mallah. tradein_clients=# SELECT version(); +-------------------------------------------------------------+ | version | +-------------------------------------------------------------+ | PostgreSQL 7.3.2 on i686-pc-linux-gnu, compiled by GCC 2.96 | +-------------------------------------------------------------+ (1 row) Time: 2183.62 ms tradein_clients=# SELECT CAST (timeofday() as timestamp with time zone) ; +----------------------------------+ | timeofday | +----------------------------------+ | 2003-05-03 00:02:25.386096+05:30 | +----------------------------------+ (1 row) Time: 2537.58 ms tradein_clients=# tradein_clients=# SELECT CAST ( now() as timestamp with time zone) ; +----------------------------------+ | now | +----------------------------------+ | 2003-05-02 20:32:34.564175+05:30 | +----------------------------------+ (1 row) Time: 673.78 ms tradein_clients=# SELECT timeofday(); +-------------------------------------+ | timeofday | +-------------------------------------+ | Fri May 02 20:34:13.634355 2003 IST | +-------------------------------------+ (1 row) Time: 647.73 ms -- Rajesh Kumar Mallah, Project Manager (Development) Infocom Network Limited, New Delhi phone: +91(11)6152172 (221) (L) ,9811255597 (M) Visit http://www.trade-india.com , India's Leading B2B eMarketplace.