[DOCS] Aggregate expression syntax - Mailing list pgsql-docs

From Thom Brown
Subject [DOCS] Aggregate expression syntax
Date
Msg-id CAA-aLv7A9uqH=U=Czp5UBbukJW6_ip7NDZsAMf6-F72s6Ls+LA@mail.gmail.com
Whole thread Raw
Responses Re: [DOCS] Aggregate expression syntax  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-docs
Hi all,

Looking at the syntax for aggregate expressions in the docs, it seems the first three forms could perhaps be merged since the ALL and DISTINCT keywords are effectively optional.

Currently:

aggregate_name (expression [ , ... ] [ order_by_clause ] ) [ FILTER ( WHERE filter_clause ) ]
aggregate_name (ALL expression [ , ... ] [ order_by_clause ] ) [ FILTER ( WHERE filter_clause ) ]
aggregate_name (DISTINCT expression [ , ... ] [ order_by_clause ] ) [ FILTER ( WHERE filter_clause ) ]

Proposed:

aggregate_name ( [ ALL | DISTINCT ] expression [ , ... ] [ order_by_clause ] ) [ FILTER ( WHERE filter_clause ) ]

I've also found a precedent for this on the SELECT statement page:

[ { UNION | INTERSECT | EXCEPT } [ ALL | DISTINCT ] select ]

Patch attached with the proposed change.

Opinions?

Thom
Attachment

pgsql-docs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Aggregate expression syntax
Next
From: David G Johnston
Date:
Subject: Re: Aggregate expression syntax