Thread: Simple time math with " No such function 'time_timespan' with the specified attributes " error

Simple time math with " No such function 'time_timespan' with the specified attributes " error

From
"HINKLEY,DUANE (Non-HP-Boise,ex1)"
Date:
I'm doing a billing system and trying to get postgresql to calculate the
difference in time.  Every way I do it I get an error with the time_timespan
function.

Here's an example:

billsys=> select stoptime - starttime from jobdetail;
ERROR:  No such function 'time_timespan' with the specified attributes


Here's the data:


id|number  |      date|starttime|stoptime|duration|description
--+--------+----------+---------+--------+--------+----------------
 1|1175    |09-09-1999|10:30:00 |11:30:00|        |test

billsys=> \d jobdetail
Table    = jobdetail
+----------------------------------+----------------------------------+-----
--+
|              Field               |              Type                |
Length|
+----------------------------------+----------------------------------+-----
--+
| id                               | int4 not null default nextval('" |
4 |
| number                           | char()                           |
8 |
| date                             | date                             |
4 |
| starttime                        | time                             |
8 |
| stoptime                         | time                             |
8 |
| duration                         | timespan                         |
12 |
| description                      | char()                           |
100 |
+----------------------------------+----------------------------------+-----
--+
Index:    jobdetail_id_key