Re: comparring dates between perl and postgres - Mailing list pgsql-novice

From Josh Berkus
Subject Re: comparring dates between perl and postgres
Date
Msg-id 200312040808.08211.josh@agliodbs.com
Whole thread Raw
In response to Re: comparring dates between perl and postgres  (hodges@xprt.net)
List 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

pgsql-novice by date:

Previous
From: Michael Glaesemann
Date:
Subject: OT: Re: Environment variables SOLVED
Next
From: Jon V
Date:
Subject: insert/query turnaround time problem...