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

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Albert Cervera i Areny <albert(at)nan-tic(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Merlin Moncure <mmoncure(at)gmail(dot)com>, Peter Geoghegan <peter(at)2ndquadrant(dot)com>, "P(dot) Christeas" <xrg(at)linux(dot)gr>
Subject: Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows
Date: 2012-10-21 06:12:27
Message-ID: CAFj8pRByaktu7+a52EVZ89AxfkS4hCzgYfeMXoQj3Y-zSBBKUQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2012/10/21 Albert Cervera i Areny <albert(at)nan-tic(dot)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(at)2ndquadrant(dot)com>
>> wrote:
>
>> > On 17 October 2012 14:53, Merlin Moncure <mmoncure(at)gmail(dot)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
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2012-10-21 07:03:36 Re: gistchoose vs. bloat
Previous Message Albert Cervera i Areny 2012-10-21 05:50:47 Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows