Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kXsaF-0001Sp-15 for pgsql-bugs@arkaria.postgresql.org; Wed, 28 Oct 2020 21:02:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kXsaC-0005l4-Mn for pgsql-bugs@arkaria.postgresql.org; Wed, 28 Oct 2020 21:02:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kXsaC-0005kx-Gn for pgsql-bugs@lists.postgresql.org; Wed, 28 Oct 2020 21:02:12 +0000 Received: from dd27502.kasserver.com ([85.13.146.49]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kXsa6-0005SR-2c for pgsql-bugs@lists.postgresql.org; Wed, 28 Oct 2020 21:02:12 +0000 Received: from [192.168.0.52] (ip-37-201-154-176.hsi13.unitymediagroup.de [37.201.154.176]) by dd27502.kasserver.com (Postfix) with ESMTPSA id 3B79560C1D4A for ; Wed, 28 Oct 2020 22:02:04 +0100 (CET) From: Wolfgang Walther Subject: Calling variadic function with default value in named notation To: pgsql-bugs@lists.postgresql.org Message-ID: <5a80bcdb-e92a-5c21-d923-f3813543771b@technowledgy.de> Date: Wed, 28 Oct 2020 22:02:02 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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