On Wed, Nov 30, 2005 at 02:53:44PM -0700, Susan Fu wrote:
> I am trying to run a very simple test on the above version. This test
> works fine on my window 8.1 version.
> If I am taking out the function on the 8.0.4 version on linux as just
> the select (SELECT DISTINCT value FROM colors) I can see the results.
> If run via a function call I got the following error:
>
> Failed to execute SQL : SQL select * from tt(); failed : ERROR: control reached end of function without RETURN
CONTEXT:PL/pgSQL function "tt"
The PL/pgSQL documentation for 8.0 and earlier says this:
The return value of a function cannot be left undefined. If control
reaches the end of the top-level block of the function without hitting
a RETURN statement, a run-time error will occur.
The 8.1 Release Notes show that this requirement has been removed:
* No longer require functions to issue a RETURN statement (Tom)
This is a byproduct of the newly added OUT and INOUT functionality.
RETURN can be omitted when it is not needed to provide the function's
return value.
--
Michael Fuhr