pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Doc: improve tutorial section about grouped aggregates.
Date: Tue, 08 Nov 2022 23:25:17 +0000
Message-ID: <E1osXy0-000Ehw-KR@gemulon.postgresql.org> (raw)

Doc: improve tutorial section about grouped aggregates.

Commit fede15417 introduced FILTER by jamming it into the existing
example introducing HAVING, which seems pedagogically poor to me;
and it added no information about what the keyword actually does.
Not to mention that the claimed output didn't match the sample
data being used in this running example.

Revert that and instead make an independent example using FILTER.
To help drive home the point that it's a per-aggregate filter,
we need to use two aggregates not just one; for consistency
expand all the examples in this segment to do that.

Also adjust the example using WHERE ... LIKE so that it'd produce
nonempty output with this sample data, and show that output.

Back-patch, as the previous patch was.  (Sadly, v10 is now out
of scope.)

Discussion: https://postgr.es/m/166794307526.652.9073408178177444190@wrigleys.postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f05a5e0003edfec027ee10d09082667036862e1c

Modified Files
--------------
doc/src/sgml/query.sgml | 65 +++++++++++++++++++++++++++++++++++++------------
1 file changed, 49 insertions(+), 16 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1osXy0-000Ehw-KR@gemulon.postgresql.org>
Permalink:  ../E1osXy0-000Ehw-KR@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1osXy0-000Ehw-KR@gemulon.postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Doc: improve tutorial section about grouped aggregates.
  In-Reply-To: <E1osXy0-000Ehw-KR@gemulon.postgresql.org>
  References: <E1osXy0-000Ehw-KR@gemulon.postgresql.org>

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

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