"The tuple structure of a not-yet-assigned record is indeterminate."

Поиск
Список
Период
Сортировка
От A B
Тема "The tuple structure of a not-yet-assigned record is indeterminate."
Дата
Msg-id dbbf25900806300433y2d92521bp446b49c2129aed39@mail.gmail.com
обсуждение исходный текст
Ответы Re: "The tuple structure of a not-yet-assigned record is indeterminate."  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Список pgsql-general
In my function I have (kept the important part)

CREATE OR REPLACE FUNCTION foo() RETURNS SETOF RECORD AS $$
DECLARE
    retval RECORD;
BEGIN
     some loop
           retval.jd := tmp.id;
           retval.d2 := _c2;
           retval.d3 := _c3;
           RETURN NEXT retval;
    end loop
return;
END;

and I get

ERROR:  record "retval" is not assigned yet
DETAIL:  The tuple structure of a not-yet-assigned record is indeterminate.
CONTEXT:  PL/pgSQL function "foo" line 33 at assignment

It seems that the line with   retval.jd := tmp.id;  is where it stops.
Any suggestion on how to fix this error?

В списке pgsql-general по дате отправления:

Предыдущее
От: "A B"
Дата:
Сообщение: Re: allowed variable names in functions?
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: "The tuple structure of a not-yet-assigned record is indeterminate."