Re: interval syntax change from 7.1.2 to 7.2.1?

From: "Gaetano Mendola" <mendola(at)bigfoot(dot)com>
To: "Jinn Koriech" <lists(at)idealint(dot)co(dot)uk>, "PostgreSQL Mailing List" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: interval syntax change from 7.1.2 to 7.2.1?
Date: 2002-07-22 17:37:45
Message-ID: 019001c231a6$7cfaab50$d60ffea9@GMENDOLA2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

From: "Jinn Koriech" <lists(at)idealint(dot)co(dot)uk> wrote:
> hi - i recently upgraded my server from 7.1.2 to 7.2.1 and now one of my
> apps is no longer functioning. this is the query:
>
> SELECT DISTINCT rate, sum(extract(epoch from interval (end_time -
> start_time)))/3600) AS duration
> FROM log
> WHERE invoice_state='8'
> GROUP BY rate HAVING rate > 0
>
> where 'end_time' and 'start_time' are columns in table 'log'
>
> the reported message is:
>
> PostgreSQL said: ERROR: parser: parse error at or near "end_time"
>
> any help greatly appreciated.
>

Redo your query putting intervall beetwen " " :

SELECT DISTINCT rate, sum(extract(epoch from "interval"(end_time -
start_time)))/3600) AS duration
FROM log
WHERE invoice_state='8'
GROUP BY rate HAVING rate > 0

Ciao
Gaetano.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Daryl Herzmann 2002-07-22 18:59:31 Queries not using Index
Previous Message Jan Wieck 2002-07-22 17:13:21 Re: Float / Numeric ?