X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6862CD9CDC for ; Thu, 10 Nov 2005 14:22:01 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 72506-05 for ; Thu, 10 Nov 2005 18:21:59 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id C4135D9BAF for ; Thu, 10 Nov 2005 14:21:59 -0400 (AST) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id jAAILiZ4039561 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 10 Nov 2005 11:21:46 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.4/8.13.4) with ESMTP id jAAILhKL093414; Thu, 10 Nov 2005 11:21:43 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.4/8.13.4/Submit) id jAAILd6S093407; Thu, 10 Nov 2005 11:21:39 -0700 (MST) (envelope-from mfuhr) Date: Thu, 10 Nov 2005 11:21:39 -0700 From: Michael Fuhr To: Rod Taylor Cc: Judith Altamirano Figueroa , pgsql-sql@postgresql.org Subject: Re: time Message-ID: <20051110182139.GA87715@winnie.fuhr.org> References: <1131635035.3529.143.camel@Desarrollo> <1131646287.819.144.camel@home> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1131646287.819.144.camel@home> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.006 required=5 tests=[AWL=0.006] X-Spam-Score: 0.006 X-Spam-Level: X-Archive-Number: 200511/92 X-Sequence-Number: 23343 On Thu, Nov 10, 2005 at 01:11:27PM -0500, Rod Taylor wrote: > rbt=# select cast(now() - date_trunc('day', now()) as time); > time > ----------------- > 13:10:42.495579 > (1 row) Am I missing something? Is there a reason not to simply cast the timestamp value to time? test=> select cast(now() - date_trunc('day', now()) as time); time --------------------- 11:19:19.8921250105 (1 row) test=> select now()::time; now ----------------- 11:19:19.892125 (1 row) test=> select cast(now() as time); now ----------------- 11:19:19.892125 (1 row) -- Michael Fuhr