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 50842316.5060700@dunslane.net
Whole thread Raw
In response to Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows  (Abhijit Menon-Sen <ams@2ndQuadrant.com>)
Responses Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows  (Andres Freund <andres@2ndquadrant.com>)
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 12:20 PM, Abhijit Menon-Sen wrote:
> At 2012-10-21 11:49:26 -0400, cbbrowne@gmail.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




pgsql-hackers by date:

Previous
From: Abhijit Menon-Sen
Date:
Subject: Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows
Next
From: "Kevin Grittner"
Date:
Subject: Re: No, pg_size_pretty(numeric) was not such a hot idea