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 8B1C0D1BA94 for ; Fri, 27 Feb 2004 18:09:21 +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 66806-05 for ; Fri, 27 Feb 2004 14:09:01 -0400 (AST) Received: from mail.michaelchaney.com (mail.michaelchaney.com [207.65.84.68]) by svr1.postgresql.org (Postfix) with ESMTP id 316B5D1D52E for ; Fri, 27 Feb 2004 14:08:53 -0400 (AST) Received: from pcp08698233pcs.500ash01.tn.comcast.net (fractal.trailer) [69.137.114.17] by mail.michaelchaney.com with esmtp (Exim 4.20 #1 (FreeBSD)) id 1AwmJ4-000HtB-Qk; Fri, 27 Feb 2004 12:01:50 -0600 Received: from mdchaney by fractal.trailer with local (Exim 3.35 #1 (Debian)) id 1AwmO9-0002Ja-00 for ; Fri, 27 Feb 2004 12:07:05 -0600 Date: Fri, 27 Feb 2004 12:07:05 -0600 From: Michael Chaney To: pgsql-sql@postgresql.org Subject: Re: Convert INT to INTERVAL? Message-ID: <20040227180705.GC8807@michaelchaney.com> References: <403F762B.20002@aol.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <403F762B.20002@aol.net> User-Agent: Mutt/1.3.28i Organization: Michael Chaney Consulting Corporation X-URL: http://www.michaelchaney.com/ X-MailScanner-Information: Please see http://www.michaelchaney.com/mail/spam.php for more information X-MailScanner: Found to be clean X-MailScanner-SpamCheck: not spam, SpamAssassin (score=-3.5, required 5, IN_REP_TO, SUBJ_ENDS_IN_Q_MARK) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/377 X-Sequence-Number: 17067 On Fri, Feb 27, 2004 at 11:54:04AM -0500, Brian Knox wrote: > Is it possible within pl/pgsql, to convert an integer to an interval in > months? IE, if num_months is an INT set to 48, can it be converted to an > interval? select (1||' months')::interval; You should be able to replace the "1" with your integer variable. Michael -- Michael Darrin Chaney mdchaney@michaelchaney.com http://www.michaelchaney.com/