X-Original-To: pgsql-sql@postgresql.org Received: from localhost (unknown [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id 8AB01924D9A for ; Tue, 20 May 2003 13:40:05 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 36727-02 for ; Tue, 20 May 2003 13:39:52 -0400 (EDT) Received: from hotmail.com (f115.law11.hotmail.com [64.4.17.115]) by developer.postgresql.org (Postfix) with ESMTP id 752289250F2 for ; Tue, 20 May 2003 13:39:51 -0400 (EDT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 20 May 2003 10:39:50 -0700 Received: from 213.185.212.126 by lw11fd.law11.hotmail.msn.com with HTTP; Tue, 20 May 2003 17:39:50 GMT X-Originating-IP: [213.185.212.126] X-Originating-Email: [jan_bodey@hotmail.com] From: "Jan Bodey" To: tgl@sss.pgh.pa.us Cc: pgsql-sql@postgresql.org Subject: Re: Date comparison question Date: Tue, 20 May 2003 18:39:50 +0100 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 20 May 2003 17:39:50.0838 (UTC) FILETIME=[D0AE5560:01C31EF6] X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/396 X-Sequence-Number: 13561 The problem I have with having the values as type interval, is that I am restricted by using Torque. I can't work out what Torque type (if any!) maps to Interval! Your 'float-times-interval' operator may well get me around that though, although I will not test until tomorrow, high time I left the office!! Cheers Jan. > >"Jan Bodey" writes: > > SELECT * FROM utable > > WHERE now() - utimestamp > interval '10 hours'; > > > The problem I am having is that the interval is not fixed, and I would >like > > to be able to store it as a value in a database table. The unit of the > > interval can, however, be fixed, and will almost certainly be fixed to > > hours. > >Do you not want to store the values as type interval? That would seem >like the most straightforward answer. If you really want to store them >as plain numbers, there's a float-times-interval operator, so you could >do something like > ... > table.float8col * interval '1 hour'; > > regards, tom lane _________________________________________________________________ Express yourself with cool emoticons - download MSN Messenger today! http://www.msn.co.uk/messenger