Re: Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows
Date
Msg-id 5084382C.3020607@dunslane.net
Whole thread Raw
In response to Re: Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 10/21/2012 01:39 PM, Tom Lane wrote:
> I'm not exactly following what that proves?  It seems like this is still
> making a not-guaranteed assumption, which is that the outer INSERT isn't
> going to choose to rearrange the order of the rows coming from the CTE.
> Strictly speaking, even "SELECT * FROM ordered_inserts" isn't promising
> anything about row order.


Hmm. If we do
    INSERT INTO foo    SELECT ... ORDER BY

is that not guaranteed to insert in the desired order? We used to 
suggest that in the old CLUSTER docs. (I realize that's not what I 
suggested, but it seems relevant nevertheless.)


cheers

andrew




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows
Next
From: Andres Freund
Date:
Subject: Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows