Re: Function returning SETOF returns nothing - Mailing list pgsql-novice

From Tom Lane
Subject Re: Function returning SETOF returns nothing
Date
Msg-id 18710.1333590230@sss.pgh.pa.us
Whole thread Raw
In response to Function returning SETOF returns nothing  (Coby Beck <coby101@gmail.com>)
Responses Re: Function returning SETOF returns nothing  (Coby Beck <coby101@gmail.com>)
List pgsql-novice
Coby Beck <coby101@gmail.com> writes:
> Thanks for the advice, Tom...I am still having trouble as many
> variations tried all give compile errors.

More modern versions give a more useful error message:

ERROR:  RETURN NEXT must specify a record or row variable in function returning row
LINE 4:     RETURN NEXT (SELECT ''old'' as type, ''item'' as item, '...
                        ^

So what you need to do is declare a variable of type ForecastData,
assign into the fields of that variable, and then "RETURN NEXT varname".

            regards, tom lane

pgsql-novice by date:

Previous
From: Coby Beck
Date:
Subject: Re: Function returning SETOF returns nothing
Next
From: Coby Beck
Date:
Subject: Re: Function returning SETOF returns nothing