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 1idJn2-000730-Jn for pgsql-docs@arkaria.postgresql.org; Fri, 06 Dec 2019 20:01:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1idJn0-0003ZN-9F for pgsql-docs@arkaria.postgresql.org; Fri, 06 Dec 2019 20:01:22 +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 1idJmz-0003ZG-Qd for pgsql-docs@lists.postgresql.org; Fri, 06 Dec 2019 20:01:22 +0000 Received: from mail-bn7nam10olkn2101.outbound.protection.outlook.com ([40.92.40.101] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1idJmv-0001Qi-Qq for pgsql-docs@lists.postgresql.org; Fri, 06 Dec 2019 20:01:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WvaYmBq+M+LC8zfB0RH7j9dEHKKLbxJJTDWN6QMR7AlEpxRSEiWTleajQcN9nkYJPPGE4JwDW0pO/i+LUI6Rv040VA12yhCx7Lz6RSJG3iI0yLVSYXmn7WcBsAiXwpgtucg25gEdNYx+w3NfHyj9WjdglgMWIPTJZM3wqzW5cNNQ2Sni7Lc1avDAkSxV9R3H5utC3Bsi6C//JQrRcCfveKXg1691ziNx5aWLSE+GZs/x/W2zdDpMjTFsxnCGFKNHcly1YkTWIAgFk9Qv7lmjts4EFZdCoH5Byw5IvJGUHxvyAGWBsTcqsooYC0oxaAYjsDKP7Yi9FpMl3O2ljcGMVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t7oe0DrE9RXiTl5UOcLtkSZVOeFU6PxnDTKNB9il5BY=; b=O2KbUFDyLhp9rpTIDqPGJeh/aGLYQgORAIOHlvvblH1dwnZztsnUXgWNf6qhyBR+0S9Bq2pP0RzdYV1AqUWgYhi38QPPMYtkrjZK2nWYs84d7Lv4YDE2OcrnMhDwdFea/ic0ZfRNwuMinovcD+2R6sKobTLHO+ITiG3Ij4B/Kdw5WArGbRAO8fORjzMadov22/BEOgzoTbXuC5TacJr8kmESh3OxkB+1y6fAM7A+Hjx0PximuDOZI5ZJdDM9ehB/8Tjp1qloh/l6f7avTRxg5k6UJiZkpP9xoqovXjzWjtKFT9thwWV2kB2B9RCyIQOprPSdXiqg8/u4086infMYzw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=t7oe0DrE9RXiTl5UOcLtkSZVOeFU6PxnDTKNB9il5BY=; b=ix6JXS4guVD6Dw7Zi/QOp0pCCKIOJ6oYjcSF7uZIkCGFpfEC6Z+6kq9yM0+ef+RXuTWdIFWz7CSKRi7TMi4yOhiUigxVhnQ6Bw4+CeCvTeYxASfnnDj5r/nN9Zloag0jF0bdjbkCjdAej48sNZhQ1wFRHyXmqQC4zuAmVmtANPL1APZxJI6nuvOVhb/LgXWDnnWOSL8GFY7r5Jjzum4GrqsJSD0xNxdBFJhykFXoBv/Dgz+ZhUL5xGAqiFV3Or9ZHRU7pbiPn6NlxH1U1iXh611Of552yGMsfikMsH4aFEqR9vSDx9t70n3UMz/6PjG4pR2wSN5w6Ym9CBEdrCEx1A== Received: from SN1NAM01FT061.eop-nam01.prod.protection.outlook.com (10.152.64.57) by SN1NAM01HT005.eop-nam01.prod.protection.outlook.com (10.152.65.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.22; Fri, 6 Dec 2019 20:01:15 +0000 Received: from DM6PR06MB5562.namprd06.prod.outlook.com (10.152.64.57) by SN1NAM01FT061.mail.protection.outlook.com (10.152.64.65) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.22 via Frontend Transport; Fri, 6 Dec 2019 20:01:15 +0000 Received: from DM6PR06MB5562.namprd06.prod.outlook.com ([fe80::8535:8b16:da9b:d2b7]) by DM6PR06MB5562.namprd06.prod.outlook.com ([fe80::8535:8b16:da9b:d2b7%6]) with mapi id 15.20.2516.014; Fri, 6 Dec 2019 20:01:14 +0000 From: John Lumby To: "pgsql-docs@lists.postgresql.org" CC: "David G. Johnston" , Tom Lane Subject: Re: description of Aggregate Expressions Thread-Topic: description of Aggregate Expressions Thread-Index: AQHVq8Cfp39padbrW02rHVPPdQZZdaetcyGAgAAI/4CAAAlrqw== Date: Fri, 6 Dec 2019 20:01:14 +0000 Message-ID: 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> ,<382.1575659855@sss.pgh.pa.us> In-Reply-To: <382.1575659855@sss.pgh.pa.us> Accept-Language: en-CA, en-US Content-Language: en-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: x-incomingtopheadermarker: OriginalChecksum:D772CFE81B7967B32BBEC31A6AAD419976708DEBE0BC801B57729A65E29DE250;UpperCasedChecksum:105D72FD9271BCB150A409A855FEA0E503B5E3C262B1EE38F2CAF4D76150AD94;SizeAsReceived:7780;Count:46 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [IUIbB7JOfetIVPr6ckD7Djur/Zo9mCk1] x-ms-publictraffictype: Email x-incomingheadercount: 46 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 87eb27a5-3512-408e-a78f-08d77a870cb4 x-ms-traffictypediagnostic: SN1NAM01HT005: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 66Pzzjyjxrrr18yyJk09hEMjeaA11HQ6drNBOiulXF0FD6YM0jpYXzPkuVIjhm+dyb9QkjKp3zp5RUXhzg6em05tqX6QusmIUIj9JZQkZSh05kANG1Sba3UII9cHoPqwNjmHuuGg69K2o7s/UtPNTRsImK36ZLCF7dHukDyFjF1IvWraAGbOoF2AhiDguFm2 x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 87eb27a5-3512-408e-a78f-08d77a870cb4 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Dec 2019 20:01:14.7824 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM01HT005 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Tom Lane wrote=0A= =0A= > > How about replacing "expression [ , ... ]" =A0by "parameter_list" in th= e description, =0A= > > and then stating that parameter_list can be either a single expression = or , =0A= > > =A0if the particular aggregate function accepts it (for which, =A0 cons= ult that function's reference),=0A= > > =A0 a comma-separated list of expressions.=0A= > =0A= > That's just as wrong. =A0As we tried to explain before, the=0A= > parenthesized-list syntax is a row constructor, so it only works=0A= > in cases where the aggregate function can accept a composite=0A= > argument type. =A0Most don't.=0A= >=0A= =0A= But surely not *all* cases of a multi-expression parameter list of an aggre= gate function are row constructors are they?=A0 =A0=A0What about=0A= =0A= select parent_id, name, GROUPING(parent_id , name), count(*) FROM mytable G= ROUP BY ROLLUP(parent_id , name);=0A= =0A= In the piece "GROUPING(parent_id , name)" ,=0A= is "(parent_id , name)" a row constructor or a list of two expressions?= =0A= =0A= Or are you saying those are one and the same thing?=0A= =0A= Cheers, John=