Re: plpgsql & date-time functions

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Fatih Cerit <fatih(at)intersan(dot)com(dot)tr>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: plpgsql & date-time functions
Date: 2005-03-14 02:33:41
Message-ID: 20050313183247.J69508@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Sean Davis 2005-03-14 02:50:32 Re: Newbie wonder...
Previous Message Jeff Hoffmann 2005-03-13 21:32:15 finding schema of table that called a trigger