public inbox for [email protected]  
help / color / mirror / Atom feed
From: John Lumby <[email protected]>
To: [email protected] <[email protected]>
Cc: David G. Johnston <[email protected]>
Cc: Tom Lane <[email protected]>
Subject: Re: description of Aggregate Expressions
Date: Fri, 6 Dec 2019 21:43:59 +0000
Message-ID: <DM6PR06MB55625AB1CB94FD039E1EEB0BA35F0@DM6PR06MB5562.namprd06.prod.outlook.com> (raw)
In-Reply-To: <DM6PR06MB5562ED9060C811718CC59605A35F0@DM6PR06MB5562.namprd06.prod.outlook.com>
References: <2A91BEF8171A5349931391E0C721CC5375705457@CPEMS-KPN501.KPNCNL.LOCAL>
	<[email protected]>
	<2A91BEF8171A5349931391E0C721CC53757054D3@CPEMS-KPN501.KPNCNL.LOCAL>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<2A91BEF8171A5349931391E0C721CC5375705528@CPEMS-KPN501.KPNCNL.LOCAL>
	<[email protected]>
	<2A91BEF8171A5349931391E0C721CC53757055C3@CPEMS-KPN501.KPNCNL.LOCAL>
	<DM6PR06MB55622DFEE2755236B8A810A0A35C0@DM6PR06MB5562.namprd06.prod.outlook.com>
	<CAKFQuwZk3Kt4uNktMgLYj5B1Rzrm1R4EMVZQRka189AhnPkM=Q@mail.gmail.com>
	<DM6PR06MB55621D8E8B9C786DAA6BA077A35F0@DM6PR06MB5562.namprd06.prod.outlook.com>
	<[email protected]>
	<DM6PR06MB5562ED9060C811718CC59605A35F0@DM6PR06MB5562.namprd06.prod.outlook.com>

John Lumby wrote:
<  
< Tom Lane wrote
< 
< > > How about replacing "expression [ , ... ]"  by "parameter_list" in the description, 
< > > and then stating that parameter_list can be either a single expression or , 
< > >  if the particular aggregate function accepts it (for which,   consult that function's reference),
< > >   a comma-separated list of expressions.
< > 
< > 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.
< >
< 
< But surely not *all* cases of a multi-expression parameter list of an aggregate function are row constructors are they?    What about
< 
< select parent_id, name, GROUPING(parent_id , name), count(*) FROM mytable GROUP BY ROLLUP(parent_id , name);
< 
< In the piece "GROUPING(parent_id , name)" ,
<   is "(parent_id , name)"  a row constructor or a list of two expressions?
< 
< Or are you saying those are one and the same thing?
< 

I think I can answer my own question   -  No they are not the same  -   because :

select parent_id, name, GROUPING(ROW(parent_id , name)), count(*) FROM mytable GROUP BY ROLLUP(parent_id , name);
ERROR:  arguments to GROUPING must be grouping expressions of the associated query level
LINE 1: select parent_id, name, GROUPING(ROW(parent_id , name)), cou...
                                         ^








view thread (18+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: description of Aggregate Expressions
  In-Reply-To: <DM6PR06MB55625AB1CB94FD039E1EEB0BA35F0@DM6PR06MB5562.namprd06.prod.outlook.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox