Skip site navigation (1) Skip section navigation (2)

Bug #443: Problem with time functions.

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #443: Problem with time functions.
Date: 2001-09-09 07:16:18
Message-ID: 200109090716.f897GIV91430@hub.org (view raw or flat)
Thread:
Lists: pgsql-bugs
Alessandro Rossi (alex(at)sunrise(dot)radiostudiodelta(dot)it>) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
Problem with time functions.

Long Description
Here is the DB and some sample entries.


CREATE TABLE "timetest" (
        "id" serial primary key,
        "timebegin" time,
        "timeend" time
        );

insert into timetest (timebegin,timeend) values ('12:00:20','12:01:00');
insert into timetest (timebegin,timeend) values ('14:00:20','14:02:00');
insert into timetest (timebegin,timeend) values ('15:00:00','15:00:40');



THIS SELECT DOESN'T WORK: 
select  sum(timeend-timebegin) as totaltime from timetest;

HERE IS WHAT POSTGRES REPORT:

timetest=# select  sum(timeend-timebegin) as totaltime from timetest;
ERROR:  Unable to select an aggregate function sum(time)
timetest=# select version();
                           version                           
-------------------------------------------------------------
 PostgreSQL 7.1.3 on i686-pc-linux-gnu, compiled by GCC 2.96
(1 row)

timetest=#

ON POSTGRES 7.0.3
timetest=# select  sum(timeend-timebegin) as totaltime from timetest;
 totaltime 
-----------
 00:03
(1 row)

timetest=# select version();
                           version                           
-------------------------------------------------------------
 PostgreSQL 7.0.3 on i686-pc-linux-gnu, compiled by gcc 2.96
(1 row)

Sample Code




No file was uploaded with this report


Responses

pgsql-bugs by date

Next:From: Robert B. EasterDate: 2001-09-09 07:21:17
Subject: Re: [PATCHES] JDBC patch (attempt#2) for util.Serialize and jdbc2.PreparedStatement
Previous:From: pgsql-bugsDate: 2001-09-09 06:57:04
Subject: Bug #442: output not exectly the given input

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group