BUGs for function returning a SETOF values on linux postgres 8.0.4, the same function runs correctly on win postgres 8.1 - Mailing list pgsql-bugs

From Susan Fu
Subject BUGs for function returning a SETOF values on linux postgres 8.0.4, the same function runs correctly on win postgres 8.1
Date
Msg-id ED6D3B86ECB6B34EB5604F5068217CE80386CB61@denexch01.den-eSniff.com
Whole thread Raw
Responses Re: BUGs for function returning a SETOF values on linux postgres 8.0.4, the same function runs correctly on win postgres 8.1
Re: BUGs for function returning a SETOF values on linux postgres 8.0.4, the same function runs correctly on win postgres 8.1
List pgsql-bugs
TITLE:
BUGs for function returning a SETOF values on linux postgres 8.0.4, the sam=
e function with the same table runs correctly on win postgres 8.1=20

Dear Sir/Madam,
   I am trying to run a very simple test on the above version. This test wo=
rks 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 s=
elect (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 re=
ached end of function without RETURN CONTEXT: PL/pgSQL function "tt"

Please help to identify if this is a bug. Details attached.
Many thanks.
Susan

-- Type definition
CREATE TYPE otyperow AS
   (f varchar);

-- Function definition
CREATE OR REPLACE FUNCTION tt()
  RETURNS SETOF otyperow AS
$BODY$
DECLARE
        oRow      oTypeRow;
     BEGIN
         FOR oRow in SELECT DISTINCT value FROM colors LOOP
             return next oRow;
         END LOOP;
END;
$BODY$
  LANGUAGE 'plpgsql' VOLATILE;

-- call the defined function
select * from tt();

-- Table field in colors table is a varchar(16).

pgsql-bugs by date:

Previous
From: "Wilfried Weiss"
Date:
Subject: BUG #2083: initdb fails with: child process was terminated by signal 11
Next
From: "tre"
Date:
Subject: BUG #2082: not a bug - just a request re user acceptability