Should we still require RETURN in plpgsql?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Should we still require RETURN in plpgsql?
Дата
Msg-id 10266.1112682503@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: Should we still require RETURN in plpgsql?  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Re: Should we still require RETURN in plpgsql?  (Dennis Bjorklund <db@zigo.dhs.org>)
Список pgsql-hackers
As of CVS tip, plpgsql handles output parameters, in the style

CREATE FUNCTION sum_n_product(x int, y int, OUT sum int, OUT prod int) AS $$
BEGIN   sum := x + y;   prod := x * y;   RETURN;
END;
$$ LANGUAGE plpgsql;

The RETURN statement is kinda useless in this example, but it is still
required, because we don't allow control to fall off the end of a
plpgsql function without causing an error.

I am thinking we should allow exit by falling off the end of the
function when (a) it has output parameter(s), or (b) it is declared
"RETURNS void".  Comments?

How does Oracle's PL/SQL handle this?
        regards, tom lane


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: PgFoundry.org busted?
Следующее
От: Christopher Kings-Lynne
Дата:
Сообщение: Re: Should we still require RETURN in plpgsql?