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

2022-07-13 Thread Shay Rojansky
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/[email protected]
[2] https://www.postgresql.org/docs/current/queries-union.html


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

2022-07-13 Thread David G. Johnston
On Wed, Jul 13, 2022 at 5:08 PM Shay Rojansky  wrote:

> 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.
>
>
Since the documentation doesn't make a guarantee there is none.  If you
want ordered output use ORDER BY.

David J.


RE: No documentation exists about ecpg ORACLE comptaible mode

2022-07-13 Thread [email protected]
Bruce Momjian  wrote:

> This is a very good point.  I have studied the issue and created the attached 
> patch to document Oracle-compatibility mode.

Hi Bruce, thank you for writing the document.
I checked it and I'm very glad!

Regards,
Takeshi Ideriha