Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1evVpl-0006F4-4U for pgsql-bugs@arkaria.postgresql.org; Mon, 12 Mar 2018 22:22:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1evVpk-000604-2y for pgsql-bugs@arkaria.postgresql.org; Mon, 12 Mar 2018 22:22:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1evVpj-0005zt-T8 for pgsql-bugs@lists.postgresql.org; Mon, 12 Mar 2018 22:22:19 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1evVpg-0001u9-Uv for pgsql-bugs@postgresql.org; Mon, 12 Mar 2018 22:22:19 +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 w2CMMDOf031651; Mon, 12 Mar 2018 18:22:13 -0400 From: Tom Lane To: "David G. Johnston" cc: "P O'Toole" , "pgsql-bugs@postgresql.org" Subject: Re: Weird return-value from pg_get_function_identity_arguments() on certain aggregate functions? In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Mon, 12 Mar 2018 15:00:07 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <31649.1520893333.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 12 Mar 2018 18:22:13 -0400 Message-ID: <31650.1520893333@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "David G. Johnston" writes: >> On Mon, Mar 12, 2018 at 2:19 PM, P O'Toole wrote: >>> According to the System Information Functions docs, >>> pg_get_function_identity_arguments(OID) should simply "get argument li= st >>> to identify a function (without default values)", but one example of h= ow it >>> behaves strangely is that: > In this case I'd say the supposed bug is that GRANT ON FUNCTION doesn't > accept the signature of a valid CREATE AGGREGATE=E2=80=8B even though ou= r existing > implementation uses it as an implementation mechanism for both (i.e., we > don't have a separate GRANT ON AGGREGATE). The entire point of pg_get_function_identity_arguments is that it's supposed to print the arguments in the form that would be accepted by GRANT, as well as DROP FUNCTION and some other commands, so I'd tend to blame pg_get_function_identity_arguments. Probably the reason nobody has noticed up to now is a dearth of user-defined ordered-set functions. Still, we're supposed to support such things, so we oughta fix it. [ pokes at it ... ] Hmm, DROP AGGREGATE will let you spell it either way, so maybe it is indeed only GRANT that's got an issue. If so, perhaps allowing this syntax there is an attractive fix. In theory there might be pg_dump files out there using this syntax. regards, tom lane