that is the problem: you got to use select, otherwise, nothing to do with
PG. if you really mean to ask perl to do it, there is a very powerful 
module (like PG's datetime feature) in perl (search CPAN by date)--I
almost used it, but since PG is so good at datetime (timestamp/interval),
I'm lazy.


On Mon, 13 Mar 2000 [EMAIL PROTECTED] wrote:

> i'm not sure about perl but a way to do it i psql:
> 
> select (now()+'3 days') from anytable;
> Thu 16 Mar 15:34:12 2000
> 
> i did it today(monday) 
> 
> 
> 
> 
> On Sun, 12 Mar 2000, edNET System Admin wrote:
> 
> > Hi, I'm trying to do something with dates which is proving to be a bit
> > tricky.
> > 
> > I'm trying to get the current "date" and add 3 days to this.
> > 
> > 
> > I've tried:
> > 
> > $date = "(now::date) + ('3 days'::interval)";
> > 
> > DBD::Pg::st execute failed: ERROR: parser: parse error at or near "3"
> > 
> > 
> > ... and : 
> > 
> > $date = "(now::date) + (\\'3 days\\'::timespan)";
> > 
> > DBD::Pg::st execute failed: ERROR: Bad date external representation
> > '(now::date) + ('3 days'::timespan)'
> > 
> > Needless to say I'm using this date creation string as a parameter of a
> > DBD::Pg CGI query, hence further complications with apostrophes.
> > 
> > I've found nothing concrete in the documentation about how to do this, and
> > the closest thing to an answer came from this newsgroup. No luck so far
> > tho'
> > 
> > does anyone know how to do this and possibly and source of good
> > documentation on this type of thing.
> > 
> > Regards
> > 
> > Scott McDaid
> > edNET
> > t: +44 131 625 5557 (direct dial)
> > t: +44 131 466 7003 (office)
> > 
> > 
> 

Reply via email to