Michael Weaver wrote:
> How do I declare a stored function to return a result set. (ie set of
> records)
>
> I can define a function returning " setof record "
> but I get an error:
>
> A column definition list is required for functions returning RECORD
>
> The docs(7.3) seem to think that this should be ok.
> so what is wrong?
You need to look a bit closer at the docs ;-)
After declaring myfunc() to return setof record, try:
select * from my_func() AS (a int8, b int8, c numeric, d numeric);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing - "the column definition list"
HTH,
Joe