Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1idJ6p-0005SR-EV for pgsql-docs@arkaria.postgresql.org; Fri, 06 Dec 2019 19:17:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1idJ6m-0004h0-HD for pgsql-docs@arkaria.postgresql.org; Fri, 06 Dec 2019 19:17:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1idJ6m-0004gt-3s for pgsql-docs@lists.postgresql.org; Fri, 06 Dec 2019 19:17:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1idJ6i-00016w-T2 for pgsql-docs@lists.postgresql.org; Fri, 06 Dec 2019 19:17: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 xB6JHZ1u000383; Fri, 6 Dec 2019 14:17:35 -0500 From: Tom Lane To: John Lumby cc: "pgsql-docs@lists.postgresql.org" , "David G. Johnston" Subject: Re: description of Aggregate Expressions In-reply-to: References: <2A91BEF8171A5349931391E0C721CC5375705457@CPEMS-KPN501.KPNCNL.LOCAL> <251962385fdc49da0da54e22588aabd6fbc2e0fa.camel@osdev.nl> <2A91BEF8171A5349931391E0C721CC53757054D3@CPEMS-KPN501.KPNCNL.LOCAL> <2CB4B3C9-F43F-49D8-A594-93DBE99EF514@elevated-dev.com> <7308f0f3a1674a39bada8571189a3735@CPEMS-KPN509.KPNCNL.LOCAL> <91CEBEAA-7260-4503-832F-E5B27B91BE1F@elevated-dev.com> <2A91BEF8171A5349931391E0C721CC5375705528@CPEMS-KPN501.KPNCNL.LOCAL> <2A91BEF8171A5349931391E0C721CC53757055C3@CPEMS-KPN501.KPNCNL.LOCAL> Comments: In-reply-to John Lumby message dated "Fri, 06 Dec 2019 18:43:39 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <381.1575659855.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 06 Dec 2019 14:17:35 -0500 Message-ID: <382.1575659855@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk John Lumby writes: > On 12/05/19 18:06, David G. Johnston wrote: >> Then I would have to say the proposed solution to this edge case is wor= se than the problem. I also don't expect there to be a clean solution to = dealing with the complexities of expressions at the syntax diagram level. > Yes, I see what I suggested is not ideal either. But I think someth= ing needs to be changed. > How about replacing "expression [ , ... ]" by "parameter_list" in the d= escription, and then stating that parameter_list can be either a single ex= pression or , if the particular aggregate function accepts it (for which= , consult that function's reference), a comma-separated list of expre= ssions. That's just as wrong. As we tried to explain before, the parenthesized-list syntax is a row constructor, so it only works in cases where the aggregate function can accept a composite argument type. Most don't. Moreover, the very same thing holds in *any* expression context, not only aggregate arguments. So if we took this seriously there would have to be a lot of other places plastered with equally confusing/unhelpful addenda. regards, tom lane