Re: plpgsql loop not returning value - Mailing list pgsql-general

From Michael Fuhr
Subject Re: plpgsql loop not returning value
Date
Msg-id 20041016162034.GA71806@winnie.fuhr.org
Whole thread Raw
In response to Re: plpgsql loop not returning value  (Josh Close <narshe@gmail.com>)
Responses Re: plpgsql loop not returning value  (Josh Close <narshe@gmail.com>)
List pgsql-general
On Sat, Oct 16, 2004 at 09:30:32AM -0500, Josh Close wrote:
> On Sat, 16 Oct 2004 00:59:34 -0600, Michael Fuhr <mike@fuhr.org> wrote:
> >
> > Add some RAISE INFO statements to print variables' values at key
> > places.  I wonder if one of your SUMs is returning NULL, causing
> > your addition to evaluate to NULL.  If so, then perhaps you should
> > use COALESCE to turn those NULLs into zeros.
>
> Thanks. That's exactly what was happening. I'm still new to postgres.

Glad you got it working.

A question about your design: you appear to have a tblBatchHistory_X
table for each iId value in tblServers.  Is there a reason for doing
that instead of having a single tblBatchHistory table with a foreign
key reference to tblServers?

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Avoiding sequential scans with OR join condition
Next
From: "Marc G. Fournier"
Date:
Subject: Re: pgsql cvs