Обсуждение: plpgsql function changes?

Поиск
Список
Период
Сортировка

plpgsql function changes?

От
David Lazar
Дата:
Hi,

I run a function that returns a setof custom type rows against pgsql
7.4.6 and it works great. The same type and function was migrated to
pgsql 8.0.3 but fails to run, returning an error:

ERROR: RETURN cannot have a parameter in function returning set; use
RETURN NEXT at or near "pkg" at character 1149

where pkg is just a declared RECORD variable.

Did something change from pgsql 7.X series set returning function to
version 8.X series???

I am thinking no... and that maybe the migration of code using
pg_restore screwed something up... any tips??

Thanks!!



Re: plpgsql function changes?

От
Tom Lane
Дата:
David Lazar <dlazar@resistorsoftware.com> writes:
> ERROR: RETURN cannot have a parameter in function returning set; use
> RETURN NEXT at or near "pkg" at character 1149

> Did something change from pgsql 7.X series set returning function to
> version 8.X series???

I think 8.0 actually complains that you made a mistake, whereas 7.x
just silently ignores it.  It's still a mistake though.

            regards, tom lane