Re: Seeking Clarification on Function Definitions in PostgreSQL Extensions

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Seeking Clarification on Function Definitions in PostgreSQL Extensions
Дата
Msg-id CAKFQuwa430SdD+fD34_hzCczf9Fv3AKR4Mds_KxPuonaFs7emQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Seeking Clarification on Function Definitions in PostgreSQL Extensions  (Ron Johnson <ronljohnsonjr@gmail.com>)
Ответы Re: Seeking Clarification on Function Definitions in PostgreSQL Extensions
Re: Seeking Clarification on Function Definitions in PostgreSQL Extensions
Список pgsql-general
On Tuesday, June 18, 2024, Ron Johnson <ronljohnsonjr@gmail.com> wrote:
On Tue, Jun 18, 2024 at 1:57 PM David G. Johnston <david.g.johnston@gmail.com> wrote:
On Tuesday, June 18, 2024, Ron Johnson <ronljohnsonjr@gmail.com> wrote:

But I stand by returning OUT params and records at the same time.

You mean you dislike adding the optional returns clause when output parameters exist? 

Correct.  It breaks the distinction between function and procedure.

How so?

The two distinctions are functions can produce sets while procedures get transaction control.

They both can produce a single multi-column output record.  The presence or absence of the optional return clause on a function definition doesn’t change that fact.
 
 
Because the out parameters and the “record” represent the exact same thing.
 
What's the purpose?  Legacy of not having procedures? 

So people can have a style guide that says always specify a returns clause on function definitions.

David J.

 

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

Предыдущее
От: Ron Johnson
Дата:
Сообщение: Re: Seeking Clarification on Function Definitions in PostgreSQL Extensions
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: HISTIGNORE in psql