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

From Pavel Stehule
Subject Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows
Date
Msg-id CAFj8pRByaktu7+a52EVZ89AxfkS4hCzgYfeMXoQj3Y-zSBBKUQ@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows  (Albert Cervera i Areny <albert@nan-tic.com>)
List pgsql-hackers
2012/10/21 Albert Cervera i Areny <albert@nan-tic.com>:
> A Dimecres, 17 d'octubre de 2012 19:13:47, Merlin Moncure va escriure:
>
>> On Wed, Oct 17, 2012 at 9:29 AM, Peter Geoghegan <peter@2ndquadrant.com>
>> wrote:
>
>> > On 17 October 2012 14:53, Merlin Moncure <mmoncure@gmail.com> wrote:
>
>> >> Is that defined in the standard?
>
>> >
>
>> > RETURNING isn't even defined in the standard.
>
>>
>
>> Right: Point being, assumptions based on implementation ordering are
>
>> generally to be avoided unless they are explicitly defined in the
>
>> standard or elsewhere.
>
>
>
> I don't see how one could use RETURNING if result is not ensured to be in
> the same order as the tuples supplied. What's the use of RETURNING supplying
> data in random order?

you don't need a ORDER, you need data - and if you need a order, then
you can use CTE and ORDER BY clause.

Proposed feature can be too limited in future - when some better
partitioning can be used or when paralel query processing will be
supported

Pavel

>
>
> --
>
> Albert Cervera i Areny
>
> http://www.NaN-tic.com
>
> Tel: +34 93 553 18 03
>
>
>
> http://twitter.com/albertnan
>
> http://www.nan-tic.com/blog
>
>



pgsql-hackers by date:

Previous
From: Albert Cervera i Areny
Date:
Subject: Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows
Next
From: Jeff Davis
Date:
Subject: Re: gistchoose vs. bloat