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 DCE80D1BA94 for ; Fri, 27 Feb 2004 18:12:45 +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 68011-05 for ; Fri, 27 Feb 2004 14:12:27 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id D4FF2D1B4DE for ; Fri, 27 Feb 2004 14:12:23 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i1RICHLi020774; Fri, 27 Feb 2004 13:12:18 -0500 (EST) To: Brian Knox Cc: pgsql-sql@postgresql.org Subject: Re: Convert INT to INTERVAL? In-reply-to: <403F762B.20002@aol.net> References: <403F762B.20002@aol.net> Comments: In-reply-to Brian Knox message dated "Fri, 27 Feb 2004 11:54:04 -0500" Date: Fri, 27 Feb 2004 13:12:17 -0500 Message-ID: <20773.1077905537@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/378 X-Sequence-Number: 17068 Brian Knox writes: > 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? Sure, just multiply by the appropriate interval value: regression=# select 48 * '1 month'::interval; ?column? ---------- 4 years (1 row) regards, tom lane