Re: comparring dates between perl and postgres

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: comparring dates between perl and postgres
Дата
Msg-id 200312040808.08211.josh@agliodbs.com
обсуждение исходный текст
Ответ на Re: comparring dates between perl and postgres  (hodges@xprt.net)
Список 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 по дате отправления:

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: OT: Re: Environment variables SOLVED
Следующее
От: Jon V
Дата:
Сообщение: insert/query turnaround time problem...