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

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Abhijit Menon-Sen <ams(at)2ndQuadrant(dot)com>
Cc: Christopher Browne <cbbrowne(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows
Date: 2012-10-21 16:30:14
Message-ID: 50842316.5060700@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 10/21/2012 12:20 PM, Abhijit Menon-Sen wrote:
> At 2012-10-21 11:49:26 -0400, cbbrowne(at)gmail(dot)com wrote:
>> If there is a natural sequence (e.g. - a value assigned by nextval()),
>> that offers a natural place to apply the usual order-imposing ORDER BY
>> that we are expected to use elsewhere.
> Note: "INSERT … RETURNING" doesn't accept an ORDER BY clause.
>

No, but you can wrap the INSERT .. RETURNING in a CTE and order that.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2012-10-21 16:36:29 Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows
Previous Message Abhijit Menon-Sen 2012-10-21 16:20:08 Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows