Clarify the ordering guarantees in combining queries (or lack thereof)

From: Shay Rojansky <roji(at)roji(dot)org>
To: pgsql-docs(at)postgresql(dot)org
Subject: Clarify the ordering guarantees in combining queries (or lack thereof)
Date: 2022-07-14 00:08:17
Message-ID: CADT4RqD0oWGCeSdGtN3UEH21HxF=1Svbr3dvEL9ueuEr-x5L4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Greetings.

I was trying to understand what - if any - are the guarantees with regards
to ordering for combining queries (UNION/UNION ALL/...). From this
message[1], it seems that UNION ALL does preserve the ordering of the
operand queries, whereas UNION does not (presumably neither do INTERSECT,
INTERSECT ALL, EXCEPT and EXCEPT ALL).

The documentation[2] makes no mention of this, I'd suggest adding a note
clarifying this.

Thanks,

Shay

[1] https://www.postgresql.org/message-id/26825.1064858799@sss.pgh.pa.us
[2] https://www.postgresql.org/docs/current/queries-union.html

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message David G. Johnston 2022-07-14 00:16:08 Re: Clarify the ordering guarantees in combining queries (or lack thereof)
Previous Message David G. Johnston 2022-07-13 02:45:13 Re: "Getting Started" guide is missing a critical step?