Обсуждение: return type marked optional but isn't

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

return type marked optional but isn't

От
PG Doc comments form
Дата:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/13/sql-createfunction.html
Description:

the documentation for creating a function shows [ RETURNS rettype | RETURNS
TABLE ( column_name column_type [, ...] ) ] but returns is not optional. At
least when specifying LANGUAGE plpgsql. All the online advice suggests
specifying RETURNS void as the solution.

Re: return type marked optional but isn't

От
"David G. Johnston"
Дата:
On Wed, Feb 21, 2024 at 10:10 AM PG Doc comments form <noreply@postgresql.org> wrote:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/13/sql-createfunction.html
Description:

the documentation for creating a function shows [ RETURNS rettype | RETURNS
TABLE ( column_name column_type [, ...] ) ] but returns is not optional. At
least when specifying LANGUAGE plpgsql. All the online advice suggests
specifying RETURNS void as the solution.

As with most conditionally option things in the docs reading the description for the item tells you when it can be omitted.

rettype: "When there are OUT or INOUT parameters, the RETURNS clause can be omitted."

David J.