Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y2nYS-0004VA-CZ for pgsql-docs@arkaria.postgresql.org; Sun, 21 Dec 2014 20:56:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y2nYR-0006t7-TR for pgsql-docs@arkaria.postgresql.org; Sun, 21 Dec 2014 20:56:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y2nE7-0005xp-Jz for pgsql-docs@postgresql.org; Sun, 21 Dec 2014 20:35:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y2nE3-0003yG-Q8 for pgsql-docs@postgresql.org; Sun, 21 Dec 2014 20:35:42 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id sBLKZarP015560; Sun, 21 Dec 2014 15:35:36 -0500 From: Tom Lane To: David Johnston cc: "pgsql-docs@postgresql.org" Subject: Re: Add Optional Variadic Invocation Explanation to 35.4.5 (xfunc-sql) In-reply-to: References: Comments: In-reply-to David Johnston message dated "Fri, 19 Dec 2014 14:33:19 -0700" Date: Sun, 21 Dec 2014 15:35:36 -0500 Message-ID: <15559.1419194136@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-docs Precedence: bulk Sender: pgsql-docs-owner@postgresql.org David Johnston writes: > This: > http://www.postgresql.org/docs/9.4/static/xfunc-sql.html > Describes how to invoke a function defined with VARIADIC with an actual > array as input instead of supplying ONE-or-more individual arguments to the > call. Right, and it does specifically say that there must be at least one actual argument matching the VARIADIC parameter. Still, an example to clarify that isn't a bad idea. > AFAICS the only way to get the called function to see an empty array is to > call it like: > SELECT varchar('text fixed 1', VARIADIC ARRAY[]::text[]) > While this is a logical solution to the problem, given the above knowledge, > it would be nice if both points were made explicitly in the documentation > in the section linked above. I did not like your proposed wording, as it seemed to complicate matters unduly by treating two independent points in the same para. I went with just adding a separate para instead: http://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=699300a146c04e207a8fdec407538cdf5368fde5 regards, tom lane -- Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-docs