pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedplpgsql & date-time functions
2+ messages / 2 participants
[nested] [flat]
* plpgsql & date-time functions
@ 2005-03-08 12:14 Fatih Cerit <fatih@intersan.com.tr>
0 siblings, 1 reply; 2+ messages in thread
From: Fatih Cerit @ 2005-03-08 12:14 UTC (permalink / raw)
To: pgsql-sql
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....
Thanks
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: plpgsql & date-time functions
@ 2005-03-14 02:33 Stephan Szabo <sszabo@megazone.bigpanda.com>
parent: Fatih Cerit <fatih@intersan.com.tr>
0 siblings, 0 replies; 2+ messages in thread
From: Stephan Szabo @ 2005-03-14 02:33 UTC (permalink / raw)
To: Fatih Cerit <fatih@intersan.com.tr>; +Cc: 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.
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-03-14 02:33 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-03-08 12:14 plpgsql & date-time functions Fatih Cerit <fatih@intersan.com.tr>
2005-03-14 02:33 ` Stephan Szabo <sszabo@megazone.bigpanda.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox