Re: Calling variadic function with default value in named notation

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Calling variadic function with default value in named notation
Дата
Msg-id CAKFQuwZu6G3GuWUS=8+VwwwHQBef5YaEnAPz6E2ZN3A1aXHUWg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Calling variadic function with default value in named notation  (Wolfgang Walther <walther@technowledgy.de>)
Ответы Re: Calling variadic function with default value in named notation  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
On Wed, Oct 28, 2020 at 11:46 PM Wolfgang Walther <walther@technowledgy.de> wrote:
One reason for the lack of complaints so far could also be, that people
don't realize it's actually possible to call variadic arguments in named
notation at all. This fact is not at all obvious from the documentation,
it's spread across different places.


As I look at this more I'm definitely agreeing that the documentation here is problematic.  Specifically, the fact that the only place about this syntax is in a chapter under Extending SQ - SQL Functions, is not good.  It really needs to be in the Syntax chapter.

That said the one place this syntax is explicitly defined says:

"The array element parameters generated from a variadic parameter are treated as not having any names of their own. This means it is not possible to call a variadic function using named arguments (Section 4.3), except when you specify VARIADIC."

And proceeds to give examples.

Given the volume of precautions listed in 10.3, Function Type Resolution, it definitely seems like an imposing challenge to evaluate and change behavior in this area.

In short, I agree that there is a need for a documentation patch, and may even write one at some point in the future.  As for making the last case work, the concept has merit but my expectations are low.

David J.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: spring context cannot load when I use postgres 42.2.15 or higher
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Calling variadic function with default value in named notation