Bad interval external representation

Started by Brickley Jeff-RA9607about 24 years ago2 messageshackers
Jump to latest
#1Brickley Jeff-RA9607
Jeff.Brickley@motorola.com

I have had a postgres 7.1.3 database running for a few months. I have
a perl application that runs several sql commands and populates the
database. I have been running the following command without any
errors until a few days ago (keep in mind that no code has changed):

insert into w_host select datetime('2001-12-10 09:00:00') as start,
int4(2001) as year, int4(50) as week, host, count(*) as jobs,
sum(cputime) as cpu, int4(reltime(sum(starttime-queuetime))) as
pending, int4(reltime(sum((finishtime-starttime)))) as wallclock,
int4(reltime(sum((finishtime-starttime)-interval(cputime-0)))) as
suspended from jobs where finishtime >= '2001-12-10 09:00:00' and
finishtime < '2001-12-10 10:00:00' and starttime != 0 and queuetime
!=0 and finishtime != 0 group by host;

The following error is generated:
ERROR: Bad interval external representation '275'

Does anyone have any ideas on how to correct this error?

Jeff

#2Brickley Jeff-RA9607
Jeff.Brickley@motorola.com
In reply to: Brickley Jeff-RA9607 (#1)
Re: Bad interval external representation

I have located the error. The cputime is of datatype double and the
conversion to the temporal type interval was failing.

jeff.brickley@motorola.com (Jeff) wrote in message news:<dea33a90.0201100923.66fa599c@posting.google.com>...

Show quoted text

I have had a postgres 7.1.3 database running for a few months. I have
a perl application that runs several sql commands and populates the
database. I have been running the following command without any
errors until a few days ago (keep in mind that no code has changed):

insert into w_host select datetime('2001-12-10 09:00:00') as start,
int4(2001) as year, int4(50) as week, host, count(*) as jobs,
sum(cputime) as cpu, int4(reltime(sum(starttime-queuetime))) as
pending, int4(reltime(sum((finishtime-starttime)))) as wallclock,
int4(reltime(sum((finishtime-starttime)-interval(cputime-0)))) as
suspended from jobs where finishtime >= '2001-12-10 09:00:00' and
finishtime < '2001-12-10 10:00:00' and starttime != 0 and queuetime
!=0 and finishtime != 0 group by host;

The following error is generated:
ERROR: Bad interval external representation '275'

Does anyone have any ideas on how to correct this error?

Jeff