Re: Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org, Abhijit Menon-Sen <ams(at)2ndquadrant(dot)com>, Christopher Browne <cbbrowne(at)gmail(dot)com>
Subject: Re: Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows
Date: 2012-10-21 18:00:12
Message-ID: 5084382C.3020607@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-10-21 18:27:39 Re: Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows
Previous Message Andres Freund 2012-10-21 17:40:09 Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows