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

Поиск
Список
Период
Сортировка
От P. Christeas
Тема Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows
Дата
Msg-id 201210171816.42494.xrg@linux.gr
обсуждение исходный текст
Ответ на Re: [PATCH] Enforce that INSERT...RETURNING preserves the order of multi rows  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Wednesday 17 October 2012, you wrote:
> "P. Christeas" <xrg@linux.gr> writes:
> > It has been a fact that the RETURNING clause on an INSERT will return
> > multiple rows with the same order as multiple VALUES have been fed.
>
> I don't believe this is a good idea in the slightest.  Yeah, the current
> implementation happens to act like that, but there is no reason that we
> should make it guaranteed behavior.  

That's my point, to push you to decide on that "feature" and clarify it in the 
documentation.

So far, it's very tempting for me to use this behavior, since I can avoid 
multiple INSERTs (=save bandwidth) and also the burden of figuring out which of 
the returned ids associates to which inserted row.

Having a discussion (or argument or a vote) like this, I think, is useful.


FYI, there is also a stack overflow question on this:
http://stackoverflow.com/questions/5439293/is-insert-returning-guaranteed-to-
return-things-in-the-right-order

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



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Identity projection
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: September 2012 commitfest