Re: Synopsis of SELECT statement: UNION, INTERSECTION, EXCEPT

From: Euler Taveira <euler(at)timbira(dot)com(dot)br>
To: dirk(dot)lattermann(at)leanix(dot)net, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Synopsis of SELECT statement: UNION, INTERSECTION, EXCEPT
Date: 2018-03-16 04:02:13
Message-ID: CAHE3wgiaV1YyQ6-v12R4bzmQoUc_5E3hBupKxHTzLXg2TOsh-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

2018-03-15 7:18 GMT-03:00 PG Doc comments form <noreply(at)postgresql(dot)org>:
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/10/static/sql-select.html
> Description:
>
> The SYNOPSIS section of the "SELECT" SQL command contains the line
>
> [ { UNION | INTERSECT | EXCEPT } [ ALL | DISTINCT ] select ]
>
> (with a boldface "select"), but it is not clear what is meant by that
> "select". Further down the page, in the "UNION clause" section (and also
> INTERSECTION or EXCEPT), it is written:
>
"select" is defined as a sub-select that can appear in the FROM clause
(see the From Clause section).

> select_statement UNION [ ALL | DISTINCT ] select_statement
>
> which uses boldface "select_statement" instead of boldface "select" as in
> the synopsis. This is confusing.
>
It is a bug in the synopsis. UNION et al cannot contain some elements
(such as ORDER BY) that is allowed for a sub-select. The attached
patch replace "select" with the correct element ("select_statement").

--
Euler Taveira Timbira -
http://www.timbira.com.br/
PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento

Attachment Content-Type Size
doc.diff text/x-patch 1.1 KB

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Euler Taveira 2018-03-16 04:17:04 Re: Documentation for varbit is missing size parameter
Previous Message Euler Taveira 2018-03-16 03:33:54 Re: Can we only add values to enums?