Re: comparring dates between perl and postgres

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: hodges(at)xprt(dot)net, SaiHertz And Control Systems <sank89(at)sancharnet(dot)in>, pgsql-novice(at)postgresql(dot)org
Subject: Re: comparring dates between perl and postgres
Date: 2003-12-04 16:08:08
Message-ID: 200312040808.08211.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hodges,

> I have never used extract. This generates a syntax error when I added
> and select extract( DOY FROM date)

Posting the syntax error would be useful if you want help.

> $sth = $dbh->prepare("SELECT
> date,address,time,host,direction,description, cal,reminder from firesides
> and select extract( DOY FROM date) where date > '$dstr1' and date <=
> '$dstr2'");

One problem is that you've used a reserved word as a column name: "date".
PostgreSQL is probably getting confused between "date" the column and "date"
the data type. Try double quoting date: "date" (or escaped for perl:
\"date\")

--
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Eldad 2003-12-04 18:28:56 PostgreSQL for Windows?
Previous Message Wolfgang Rohdewald 2003-12-04 00:12:24 'import site' failed; use -v for traceback