Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 5D5FE9FB4E4 for ; Fri, 20 Apr 2007 22:03:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 49251-08 for ; Fri, 20 Apr 2007 22:02:58 -0300 (ADT) X-Greylist: delayed 00:24:05.621295 by SQLgrey-1.7.4 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 5AE359FB385 for ; Fri, 20 Apr 2007 22:03:03 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from polaris.pinpointresearch.com (66-7-238-130.static-ip.telepacific.net [66.7.238.130]) by svr4.postgresql.org (Postfix) with ESMTP id 495AD5AF03C for ; Sat, 21 Apr 2007 00:38:57 +0000 (GMT) Received: from [192.168.1.179] (betelgeuse.pinpointresearch.com [192.168.1.179]) by polaris.pinpointresearch.com (Postfix) with ESMTP id 724D0E0103A1; Fri, 20 Apr 2007 17:38:54 -0700 (PDT) Message-ID: <46295D1E.6070809@pinpointresearch.com> Date: Fri, 20 Apr 2007 17:38:54 -0700 From: Steve Crawford User-Agent: Thunderbird 1.5.0.10 (X11/20060911) MIME-Version: 1.0 To: =?ISO-8859-1?Q?Rodrigo_De_Le=F3n?= Cc: pgsql-sql@postgresql.org, Wei Weng Subject: Re: Question on interval References: <46290C34.9080507@kencast.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.046 tagged_above=0 required=5 tests=AWL=-0.090, BAYES_50=0.001, FORGED_RCVD_HELO=0.135 X-Spam-Level: X-Archive-Number: 200704/201 X-Sequence-Number: 28201 Rodrigo De Le=F3n wrote: > On 4/20/07, Wei Weng wrote: >> Hi all. >> >> How do I write a query that converts an interger to the interval type?= >> >> Like convert integer 10 to INTERVAL '10 seconds'? >> >> The integer is a column in a table though, so it is more like convert >> integer tbl.theInteger to INTERVAL 'tbl.theInteger seconds". >> >> Thanks! >> >> >> Wei >=20 > select (10||' sec')::interval; Or, if you prefer: select 10*'1 second'::interval; Cheers, Steve