[DOCS] Aggregate expression syntax

Поиск
Список
Период
Сортировка
От Thom Brown
Тема [DOCS] Aggregate expression syntax
Дата
Msg-id CAA-aLv7A9uqH=U=Czp5UBbukJW6_ip7NDZsAMf6-F72s6Ls+LA@mail.gmail.com
обсуждение исходный текст
Ответы Re: [DOCS] Aggregate expression syntax  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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
Вложения

В списке pgsql-docs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Aggregate expression syntax
Следующее
От: David G Johnston
Дата:
Сообщение: Re: Aggregate expression syntax