dbTalk Databases Forums  

Re: [BUGS] BUGs for function returning a SETOF values on linux postgres 8.0.4, the same function runs correctly on win postgres 8.1

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] BUGs for function returning a SETOF values on linux postgres 8.0.4, the same function runs correctly on win postgres 8.1 in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUGs for function returning a SETOF values on linux postgres 8.0.4, the same function runs correctly on win postgres 8.1 - 12-01-2005 , 11:27 AM






"Susan Fu" <susan.fu (AT) vericept (DOT) com> writes:
Quote:
Failed to execute SQL : SQL select * from tt(); failed : ERROR: control =
reached end of function without RETURN CONTEXT: PL/pgSQL function "tt"
This is not a bug. 8.0 requires a RETURN in all cases. 8.1 is laxer
about it.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
  #2  
Old   
Michael Fuhr
 
Posts: n/a

Default Re: [BUGS] BUGs for function returning a SETOF values on linux postgres 8.0.4, the same function runs correctly on win postgres 8.1 - 12-01-2005 , 11:34 AM






On Wed, Nov 30, 2005 at 02:53:44PM -0700, Susan Fu wrote:
Quote:
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

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.