Re: Document ordering guarantees on INSERT/UPDATE RETURNING clause - Mailing list pgsql-hackers

From Julien Rouhaud
Subject Re: Document ordering guarantees on INSERT/UPDATE RETURNING clause
Date
Msg-id 20220226145901.rktwrap2uuky5xtw@jrouhaud
Whole thread Raw
In response to Re: Document ordering guarantees on INSERT/UPDATE RETURNING clause  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Document ordering guarantees on INSERT/UPDATE RETURNING clause
List 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@roji.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.



pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Document ordering guarantees on INSERT/UPDATE RETURNING clause
Next
From: Melanie Plageman
Date:
Subject: Re: why do hash index builds use smgrextend() for new splitpoint pages