X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 6F6689DCC26 for ; Tue, 6 Dec 2005 13:09:17 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 44312-10 for ; Tue, 6 Dec 2005 13:09:16 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id 17A5F9DCAEF for ; Tue, 6 Dec 2005 13:09:14 -0400 (AST) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id jB6H92mK075958 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 6 Dec 2005 10:09:05 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.4/8.13.4) with ESMTP id jB6H92iQ097225; Tue, 6 Dec 2005 10:09:02 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.4/8.13.4/Submit) id jB6H92bA097224; Tue, 6 Dec 2005 10:09:02 -0700 (MST) (envelope-from mfuhr) Date: Tue, 6 Dec 2005 10:09:02 -0700 From: Michael Fuhr To: Bruce Momjian Cc: Magdalena Komorowska , pgsql-sql@postgresql.org Subject: Re: Date Interval Message-ID: <20051206170902.GA97204@winnie.fuhr.org> References: <20051206135906.ECA9713E35@spinet.pl> <200512061654.jB6Gs5d14178@candle.pha.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200512061654.jB6Gs5d14178@candle.pha.pa.us> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[UPPERCASE_25_50=0] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/48 X-Sequence-Number: 23590 On Tue, Dec 06, 2005 at 11:54:05AM -0500, Bruce Momjian wrote: > test=> SELECT current_timestamp + cast(x || ' months' AS INTERVAL) FROM > test; > ?column? > ------------------------------- > 2006-03-06 11:53:05.574279-05 > (1 row) Or another way: test=> CREATE TABLE test (x numeric); CREATE TABLE test=> INSERT INTO test VALUES (3); INSERT 0 1 test=> SELECT current_timestamp + x * interval'1 month' FROM test; ?column? ------------------------------- 2006-03-06 12:07:48.112765-05 (1 row) -- Michael Fuhr