Received: from pns.mm.eutelsat.org (pns.mm.eutelsat.org [194.214.173.227]) by postgresql.org (Postfix) with ESMTP id 1D804475917 for ; Mon, 22 Jul 2002 13:35:55 -0400 (EDT) Received: from nts-03.mm.eutelsat.org (localhost [127.0.0.1]) by pns.mm.eutelsat.org (8.11.6/linuxconf) with ESMTP id g6MHZbd07982; Mon, 22 Jul 2002 19:35:37 +0200 Received: from dell-01.mm.eutelsat.org (IDENT:root@dell-01.mm.eutelsat.org [194.214.173.17]) by nts-03.mm.eutelsat.org (8.9.3/8.8.7) with ESMTP id SAA22618; Mon, 22 Jul 2002 18:29:13 +0200 Received: from GMENDOLA2 (gmendola2.mm.eutelsat.org [194.214.173.26]) by dell-01.mm.eutelsat.org (8.11.2/8.8.7) with SMTP id g6MHZ6c22841; Mon, 22 Jul 2002 19:35:06 +0200 Message-ID: <019001c231a6$7cfaab50$d60ffea9@GMENDOLA2> From: "Gaetano Mendola" To: "Jinn Koriech" , "PostgreSQL Mailing List" References: <1027357127.1451.0.camel@morph.magiclamp.2y.net> Subject: Re: interval syntax change from 7.1.2 to 7.2.1? Date: Mon, 22 Jul 2002 19:37:45 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Archive-Number: 200207/336 X-Sequence-Number: 8714 From: "Jinn Koriech" 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.