Re: Document ordering guarantees on INSERT/UPDATE RETURNING clause

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Shay Rojansky <roji(at)roji(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Document ordering guarantees on INSERT/UPDATE RETURNING clause
Date: 2022-02-26 14:59:01
Message-ID: 20220226145901.rktwrap2uuky5xtw@jrouhaud
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Sat, Feb 26, 2022 at 06:25:22AM -0700, David G. Johnston wrote:
> On Sat, Feb 26, 2022 at 5:42 AM Shay Rojansky <roji(at)roji(dot)org> wrote:
>
> > FWIW I've received feedback from a SQL Server engineer that one definitely
> > should *not* depend on such ordering there, and that future optimizations
> > (e.g. parallel insertion of many rows) could result in row ordering which
> > differs from the lexical ordering of the VALUES clause.
> >
>
>
> > That seems very reasonable; if the situation is similar on PostgreSQL,
> > then I'd suggest making that very clear in the INSERT[2] and UPDATE[3] docs.
> >
>
> There is clearly no mention of such a guarantee in our documentation.

Yes, which is just how SQL works: a set doesn't have any ordering unless an
explicit one has been defined, RETURNING is no exception to that.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2022-02-26 15:47:34 Re: why do hash index builds use smgrextend() for new splitpoint pages
Previous Message David G. Johnston 2022-02-26 13:25:22 Re: Document ordering guarantees on INSERT/UPDATE RETURNING clause