Re: unclear syntax explanation for multiple window definitions in a SELECT query

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: postgresql(at)mackler(dot)email, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: unclear syntax explanation for multiple window definitions in a SELECT query
Date: 2023-02-16 16:13:25
Message-ID: CAKFQuwaGrwFF0Y234+n7wXK0FtWyO5=hucD9Qd6MpCrJKiqT7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Thu, Feb 16, 2023 at 5:13 AM PG Doc comments form <noreply(at)postgresql(dot)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.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Adam Mackler 2023-02-16 17:18:41 Re: unclear syntax explanation for multiple window definitions in a SELECT query
Previous Message PG Doc comments form 2023-02-16 09:54:04 unclear syntax explanation for multiple window definitions in a SELECT query