X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A6FD456712 for ; Mon, 14 Mar 2005 02:37:58 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 33271-10 for ; Mon, 14 Mar 2005 02:37:55 +0000 (GMT) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id 0CE0356863 for ; Mon, 14 Mar 2005 02:33:39 +0000 (GMT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 3207235660; Sun, 13 Mar 2005 18:33:41 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 6DE9435653; Sun, 13 Mar 2005 18:33:41 -0800 (PST) Date: Sun, 13 Mar 2005 18:33:41 -0800 (PST) From: Stephan Szabo To: Fatih Cerit Cc: pgsql-sql@postgresql.org Subject: Re: plpgsql & date-time functions In-Reply-To: Message-ID: <20050313183247.J69508@megazone.bigpanda.com> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/181 X-Sequence-Number: 20660 On Tue, 8 Mar 2005, Fatih Cerit wrote: > I have a function and I want to update a table's two rows but having problem > with plpgsql & date-time functions. First field of the table must be now() > this is ok.. but the second field must be now() + '60 days' if the query > like this : SELECT INTO to_day now() + interval '60 days' ; it works but if > I use variable instead of '60 days' it doesn't work. And I must use > variable.... If you want a variable number of days, something like now() + variable * interval '1 day' will probably work.