Calling variadic function with default value in named notation

Поиск
Список
Период
Сортировка
От Wolfgang Walther
Тема Calling variadic function with default value in named notation
Дата
Msg-id 5a80bcdb-e92a-5c21-d923-f3813543771b@technowledgy.de
обсуждение исходный текст
Ответы Re: Calling variadic function with default value in named notation  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Hi,

I tried the following on PG 12.4 and PG 13.0:


create function a(x int, y int[] default '{}')
returns void language sql as '';

create function b(x int, variadic y int[] default '{}')
returns void language sql as '';

-- 1
select a(1, '{2}');
-- 2
select b(1, 2);
-- 3
select a(x=>1, y=>'{2}');
-- 4
select b(x=>1, variadic y=>'{2}');
-- 5
select a(1);
-- 6
select b(1);
-- 7
select a(x=>1);
-- 8
select b(x=>1);


The first 7 calls succeed, but the last one is failing with:


ERROR: function b(x => integer) does not exist
LINE 1: select b(x=>1);
                ^
HINT: No function matches the given name and argument types. You might 
need to add explicit type casts.


So while I am able to call the variadic function in named notation (call 
4) or with the default value (call 6) - I am not able to put both 
together in call 8.

I could not find anything in the documentation that points this out as a 
limitation, so I expected this to work. Did I miss anything?

Thanks

Wolfgang



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: BUG #16688: psql removes only LF without CR at end of backquotes on windows.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Calling variadic function with default value in named notation