pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gaetano Mendola <mendola@bigfoot.com>
To: Jinn Koriech <lists@idealint.co.uk>
To: PostgreSQL Mailing List <pgsql-sql@postgresql.org>
Subject: Re: interval syntax change from 7.1.2 to 7.2.1?
Date: Mon, 22 Jul 2002 19:37:45 +0200
Message-ID: <019001c231a6$7cfaab50$d60ffea9@GMENDOLA2> (raw)
References: <1027357127.1451.0.camel@morph.magiclamp.2y.net>

From: "Jinn Koriech" <lists@idealint.co.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.




view thread (3+ messages)

Message-ID: <019001c231a6$7cfaab50$d60ffea9@GMENDOLA2>
Permalink:  ../019001c231a6$7cfaab50$d60ffea9@GMENDOLA2/
Also on:    postgresql.org/message-id/019001c231a6$7cfaab50$d60ffea9@GMENDOLA2

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mendola@bigfoot.com, lists@idealint.co.uk
  Subject: Re: interval syntax change from 7.1.2 to 7.2.1?
  In-Reply-To: <019001c231a6$7cfaab50$d60ffea9@GMENDOLA2>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox