From: | "Susan Fu" <susan(dot)fu(at)vericept(dot)com> |
---|---|
To: | <pgsql-bugs(at)postgresql(dot)org> |
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: | 2005-11-30 21:53:44 |
Message-ID: | ED6D3B86ECB6B34EB5604F5068217CE80386CB61@denexch01.den-eSniff.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
TITLE:
BUGs for function returning a SETOF values on linux postgres 8.0.4, the same function with the same table runs correctly on win postgres 8.1
Dear Sir/Madam,
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"
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).
From | Date | Subject | |
---|---|---|---|
Next Message | Euler Taveira de Oliveira | 2005-11-30 23:34:13 | Re: BUG #2077: Hiding databases which I am not owner |
Previous Message | Dirk Lutzebäck | 2005-11-30 21:44:11 | Re: pg_dump: schema with OID 559701082 does not exist |