Re: Encountering NULLS in plpgsql

From: Richard Huxton <dev(at)archonet(dot)com>
To: Randy Yates <yates(at)ieee(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Encountering NULLS in plpgsql
Date: 2006-03-20 11:53:17
Message-ID: 441E97AD.8000002@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Randy Yates wrote:
> dev(at)archonet(dot)com (Richard Huxton) writes:
>
>> Randy Yates wrote:
>>> I wrote a simple pl to compute running sums, but when it
>>> encountered a null on a float4 value it caused pgadminIII to
>>> crash (exited abruptly). Is this intended behavior?
>> No, but we'll need more information to figure out what is going on.
>>
>
> Sure - see below.
>
>> What language did you use for the procedural code? Can you show us
>> that code?

> outrow."fBookBalance" := outrow."fBookBalance" + inprow."fAmount";

I'm assuming that fAmount is the column that can be null.

> CREATE OR REPLACE VIEW vewChecking AS SELECT * FROM fcnCheckingRow();
>
If you just do "SELECT * FROM vewChecking" in psql I assume it all works OK?

>> What version of postgreSQL?
>
> PostgreSQL 8.0.3 on i386-redhat-linux-gnu, compiled by GCC
> i386-redhat-linux-gcc (GCC) 4.0.0 20050505 (Red Hat 4.0.0-4)

There should be a more recent RPM available for you - 8.0.7 is the latest.

>> What version of pgAdmin III?
>
> 1.4.1 (under FC4/i386)
>
>> Was there any error message?
>
> Not that I saw.

Hmm - seems to work OK for me with pgAdmin III (v 1.4.0) installed via
deb-src-file on Ubuntu. At least a "view data" on the view seems to work.

>> Is there anything in the logs?
>
> Here's pgsql/data/pg_log/postgresql-Thu.log, when the error would've
> happened:

> LOG: unexpected EOF on client connection LOG: unexpected EOF on
> client connection

That certainly looks like it's the client application that's the problem.

Version 1.4.2 of pgadmin is out, but I don't think RPMs are available
yet for FC4. Worth checking the change-log and mailing lists for pgadmin
though:
http://www.pgadmin.org/development/changelog.php

I'd see if anyone has FC4 RPMs of the new version and see if that solves
your problem.

HTH
--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Qingqing Zhou 2006-03-20 11:54:17 Re: PANIC: heap_update_redo: no block
Previous Message Guido Neitzer 2006-03-20 11:01:33 Re: Difference between "add column" and "add column" with default