Hi all,
I'm experiencing problem with Postgresql 7.4Beta 3,
the following function is working in Postgres 7.3.X and
if I remember well also in 7.4beta2:

CREATE TYPE foo_type AS (a INTEGER);

CREATE OR REPLACE FUNCTION foo ( )
RETURNS SETOF foo_type AS'
DECLARE
    my_var  foo_type%rowtype;
BEGIN

    FOR my_var IN
       SELECT 2
    LOOP
       RETURN NEXT my_var;
    END LOOP;

    RETURN;

END;
' LANGUAGE 'plpgsql';



now I obtain:

test=# select * from foo();
ERROR:  "foo_type" is a composite type
CONTEXT:  compile of PL/pgSQL function "foo" near line 2

is the intended behaviour ?


Regards
Gaetano Mendola


Tue, 30 Sep 2003 02:01:34 +0200
Gaetano Mendola <mendola@bigfoot.com>
ERROR:  "foo_type" is a composite type
Gaetano Mendola <mendola@bigfoot.com> writes:
> CREATE TYPE foo_type AS (a INTEGER);

> DECLARE
>     my_var  foo_type%rowtype;

> ERROR:  "foo_type" is a composite type
> CONTEXT:  compile of PL/pgSQL function "foo" near line 2

Hmm, that was an unintended side-effect of another change.
I can't see any strong reason to forbid this programming
pattern, so I'll fix it.  Thanks for the report.

			regards, tom lane

Mon, 29 Sep 2003 20:51:58 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: ERROR: "foo_type" is a composite type 