X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 90AEB4753A1 for ; Mon, 10 Feb 2003 13:21:28 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id D297F474E53 for ; Mon, 10 Feb 2003 13:21:27 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h1AILP5u015568; Mon, 10 Feb 2003 13:21:26 -0500 (EST) To: Stephan Szabo Cc: john@flowlabs.com, pgsql-sql@postgresql.org Subject: Re: problems with date and interval queries. In-reply-to: <20030210101150.P99596-100000@megazone23.bigpanda.com> References: <20030210101150.P99596-100000@megazone23.bigpanda.com> Comments: In-reply-to Stephan Szabo message dated "Mon, 10 Feb 2003 10:14:15 -0800" Date: Mon, 10 Feb 2003 13:21:25 -0500 Message-ID: <15567.1044901285@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/197 X-Sequence-Number: 11595 Stephan Szabo writes: > interval is the form for an interval literal. If the column is > already an interval, you probably don't need it at all. If you need to > cast it you should do a cast CAST (num_min AS INTERVAL) I don't believe there is a cast from any numeric type to interval. I'd recommend the interval-times-float operator. It should work to write num_min * interval '1 min' This approach has the advantage that it trivially adapts to whatever unit you happen to have the column stated in (seconds, minutes, days, ...) regards, tom lane