Re: unclear syntax explanation for multiple window definitions in a SELECT query - Mailing list pgsql-docs

From David G. Johnston
Subject Re: unclear syntax explanation for multiple window definitions in a SELECT query
Date
Msg-id CAKFQuwaGrwFF0Y234+n7wXK0FtWyO5=hucD9Qd6MpCrJKiqT7w@mail.gmail.com
Whole thread Raw
In response to unclear syntax explanation for multiple window definitions in a SELECT query  (PG Doc comments form <noreply@postgresql.org>)
Responses Re: unclear syntax explanation for multiple window definitions in a SELECT query
List pgsql-docs
On Thu, Feb 16, 2023 at 5:13 AM PG Doc comments form <noreply@postgresql.org> wrote:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/15/sql-select.html
Description:

The syntax documentation for SELECT in SQL COMMANDS section is unclear in
explaining how to use multiple window definitions.  It's easy to read it and
believe that multiple WINDOW keywords, one for each definition, are correct,
which is not the case.

See this stackoverflow question and answer on point:
https://stackoverflow.com/questions/59651529/multiple-named-windows-in-a-postgres-query


This is how we've chosen to document this kind of grammar and I don't see a compelling reason to revisit that decision on the basis of this report.  I could consider some additional wording regarding "each clause keyword only ever appears once in a given (sub)query" though that seems almost self-evident as part of the learning of SQL.  The fact that you write WINDOW and then a comma-separated listing of names plus definitions is how that syntax diagram is read, just like with WITH, FROM, and GROUP BY clauses in the same diagram.

David J.

pgsql-docs by date:

Previous
From: PG Doc comments form
Date:
Subject: unclear syntax explanation for multiple window definitions in a SELECT query
Next
From: Adam Mackler
Date:
Subject: Re: unclear syntax explanation for multiple window definitions in a SELECT query