X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 78455D1B532 for ; Mon, 10 Nov 2003 15:30:58 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 25304-05 for ; Mon, 10 Nov 2003 11:30:31 -0400 (AST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id ABD0CD1B531 for ; Mon, 10 Nov 2003 11:30:27 -0400 (AST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id C7D5A353A6; Mon, 10 Nov 2003 07:30:26 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id C6B82351CE; Mon, 10 Nov 2003 07:30:26 -0800 (PST) Date: Mon, 10 Nov 2003 07:30:26 -0800 (PST) From: Stephan Szabo To: Kumar Cc: psql Subject: Re: Dynamic Query for System functions - now() In-Reply-To: <017701c3a75a$0e3e6050$7502a8c0@hdsc.com> Message-ID: <20031110072842.K16647@megazone.bigpanda.com> References: <017701c3a75a$0e3e6050$7502a8c0@hdsc.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/88 X-Sequence-Number: 15903 On Mon, 10 Nov 2003, Kumar wrote: > select now()+ interval'1 month'; -- This is working fine. > > I wanna dynamically assign the interval number. i,e --> select now()+ > interval'n month'; If n is an integer, I'd suggest something like select now() + n * interval '1 month'; rather than messing around with the text of the interval literal.