Re: [HACKERS] PL/pgSQL - for discussion (RETURN)

Поиск
Список
Период
Сортировка
От Zeugswetter Andreas
Тема Re: [HACKERS] PL/pgSQL - for discussion (RETURN)
Дата
Msg-id 01BD4E70.E6F10220@pc9358.sd.spardat.at
обсуждение исходный текст
Ответы Re: [HACKERS] PL/pgSQL - for discussion (RETURN)  (jwieck@debis.com (Jan Wieck))
Список pgsql-hackers
>        Returning from the function
>
>                RETURN <expr>;
>
>            The function terminates and the value of <expr>  will  be
>            returned  to  the  upper executor.  The return value of a
>            function cannot be undefined.  If control reaches the end
>            of  the  toplevel block of the function without hitting a
>            RETURN statement, a runtime error will occur.

1. I think we should allow functions/procedures, that don't have a return value.
    (think about a proc that only does an update, why return anything except an error)
2. I think the RETURN will need a WITH RESUME, so a procedure can return more than one row.

create dba procedure "dns".getusers()
returning varchar(16), smallint;
define gotuser varchar(16);
define gotadmin smallint;
execute procedure checkadmin();
foreach select uname, admin into gotuser, gotadmin from passwd
        return gotuser, gotadmin with resume;
end foreach;
end procedure;

Andreas



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

Предыдущее
От: Zeugswetter Andreas
Дата:
Сообщение: Re: [HACKERS] PL/pgSQL - for discussion (ELOG)
Следующее
От: Andrew Martin
Дата:
Сообщение: Re: [HACKERS] varchar() vs char16 performance