BUG #5310: "NOT FOUND" throws "GetData to Procedure return failed." in stored functions - Mailing list pgsql-bugs

From Lothar Bongartz
Subject BUG #5310: "NOT FOUND" throws "GetData to Procedure return failed." in stored functions
Date
Msg-id 201002031614.o13GESkb075957@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #5310: "NOT FOUND" throws "GetData to Procedure return failed." in stored functions  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: BUG #5310: "NOT FOUND" throws "GetData to Procedure return failed." in stored functions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      5310
Logged by:          Lothar Bongartz
Email address:      lotharbongartz@hotmail.com
PostgreSQL version: 8.4
Operating system:   Windows XP Professioanl
Description:        "NOT FOUND" throws "GetData to Procedure return failed."
in stored functions
Details:

A "NOT FOUND" condition in a stored function throws a "GetData to Procedure
return failed." error, which cannot be trapped by the EXCEPTION handling.
Example:

SELECT msg_id INTO v_nm FROM newmail WHERE memb_id=v_id;

The only way to avoid the complete failing of the stored function is to do a
check before:

IF EXISTS (SELECT * FROM newmail WHERE memb_id=v_id) THEN
    SELECT msg_id INTO v_nm FROM newmail WHERE memb_id=v_id;
END IF;

pgsql-bugs by date:

Previous
From: "John"
Date:
Subject: BUG #5311: Won't install.
Next
From: Pavel Stehule
Date:
Subject: Re: BUG #5310: "NOT FOUND" throws "GetData to Procedure return failed." in stored functions