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

Поиск
Список
Период
Сортировка
От P. Christeas
Тема Re: Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows
Дата
Msg-id 201210211940.33857.xrg@linux.gr
обсуждение исходный текст
Ответ на Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows  (Abhijit Menon-Sen <ams@2ndQuadrant.com>)
Список pgsql-hackers
On Sunday 21 October 2012, 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.

Exactly. And IMHO it should never have.

The real trouble is when you insert some arbitrary values, which have no
implicit order or primary key /before/ the insert will assign them one. Then,
you need to map them to the SERIAL they got.

Or else, you can't use the multi-row INSERT and must just do many INSERTs.





--
Say NO to spam and viruses. Stop using Microsoft Windows!



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Successor of MD5 authentication, let's use SCRAM