Re: clarification on chaining of set operations

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: cpainterwakefield(at)gmail(dot)com
Cc: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: clarification on chaining of set operations
Date: 2021-10-04 23:40:38
Message-ID: 4017319.1633390838@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

PG Doc comments form <noreply(at)postgresql(dot)org> writes:
> Regarding section 7.4 of the documentation. I was curious about the
> behavior when combining different set operations in one query, e.g,
> query1 op1 query2 op2 query3;
> where op1 and op2 are one of UNION, INTERSECT, EXCEPT.

> The documentation suggests that this is equivalent to
> (query1 op1 query2) op2 query3;
> but only states it for the case when op1 = op2 = UNION.

The SELECT reference page explains that INTERSECT binds more tightly
than UNION or EXCEPT. I think it's an oversight that section 7.4
doesn't mention that.

regards, tom lane

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message PG Doc comments form 2021-10-05 09:42:36 Correction to documentation at https://www.postgresql.org/docs/12/kernel-resources.html
Previous Message PG Doc comments form 2021-10-04 23:08:37 clarification on chaining of set operations