Re: Guidance on INSERT RETURNING order - Mailing list pgsql-general

From Federico
Subject Re: Guidance on INSERT RETURNING order
Date
Msg-id CAN19dyfb8aPqSgsMpSEZNA85bu-JH1+NpUHccWe09FbSgKt0Mw@mail.gmail.com
Whole thread Raw
In response to Re: Guidance on INSERT RETURNING order  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Sat, 15 Apr 2023 at 15:40, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Federico <cfederico87@gmail.com> writes:
> > I think the tuple order would not be connected to the values, but be
> > determined by the input order of the rows in the insert. So when using
> > INSERT ... SELECT the tuple_order value would be determined by the
> > output of the select, using the same logic as ROW_NUMBER.
>
> We already rejected the idea that INSERT must preserve the order of
> the incoming tuples.  Please don't re-propose it with different
> wording.
>
>                         regards, tom lane

That was not my intention, what I meant is that the hypothetical
inserted.tuple_order in case of insert .. select would be determined
by the output order of the select. Insert would be free to insert the
row as it pleases.
Sorry if it wasn't clear.

Best
  Federico



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Guidance on INSERT RETURNING order
Next
From: Arquimedes Aguirre
Date:
Subject: RE: FW: Error!