Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 7DF7B9FB6FA for ; Fri, 20 Apr 2007 16:29:10 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 70857-02 for ; Fri, 20 Apr 2007 16:29:07 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.250]) by postgresql.org (Postfix) with ESMTP id 6EAEF9FB2F2 for ; Fri, 20 Apr 2007 16:29:06 -0300 (ADT) Received: by an-out-0708.google.com with SMTP id c24so1085834ana for ; Fri, 20 Apr 2007 12:29:06 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Q9cAAmYnapSpT/uIOT75iiE2agm8fF5wGzDhiw05bZ/Z1XtWySBgkPoRdubE3NELFiKxrGHQGc0cmsnjcDcxQoQG8JF32o1U8uWJrS67XqRh2qTB27ffyTM+nh3vQUv6Rd/L1PtDKxotIDKvpP/r4hj9f79/dD3huyaZzMzoh6Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=udLGLlPu+pPidFtWPYQYo5MX0oHFHoYK0kwsJalW23q74CXhKaGIPKVvrEv/RkveXYVa1UyIwsAD9FKCcBBPf5YUDhqLJkk4FjLZXG+hE7SZML3/iAEgq1jngmwULPI/++6wn1pBK9SD3L42XSTV0N+MKNwee6UyMQntt0Kp0UM= Received: by 10.100.121.12 with SMTP id t12mr1941949anc.1177097345345; Fri, 20 Apr 2007 12:29:05 -0700 (PDT) Received: by 10.100.154.9 with HTTP; Fri, 20 Apr 2007 12:29:05 -0700 (PDT) Message-ID: Date: Fri, 20 Apr 2007 14:29:05 -0500 From: "=?ISO-8859-1?Q?Rodrigo_De_Le=F3n?=" To: pgsql-sql@postgresql.org Subject: Re: Question on interval Cc: "Wei Weng" In-Reply-To: <46290C34.9080507@kencast.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <46290C34.9080507@kencast.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/198 X-Sequence-Number: 28198 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 select (10||' sec')::interval;