Re: Insert Documentation - Returning Clause and Order

Поиск
Список
Период
Сортировка
От Ashutosh Bapat
Тема Re: Insert Documentation - Returning Clause and Order
Дата
Msg-id CAExHW5t-qErdoEnrO5N3=UwYN16NjKn0VG0M7M7pXZfyobv_iQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Insert Documentation - Returning Clause and Order  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: Insert Documentation - Returning Clause and Order  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-hackers
On Sat, Dec 12, 2020 at 8:41 PM David G. Johnston
<david.g.johnston@gmail.com> wrote:
>
> On Sat, Dec 12, 2020 at 7:02 AM James Coleman <jtc331@gmail.com> wrote:
>>
>>
>> Certainly almost every ORM, and maybe even other forms of application
>> code, need to be able to associate the serial column value returned
>> with what it inserted.
>
>
> Yet most ORM would perform single inserts at a time, not in bulk, making such a feature irrelevant to them.
>
> I don't think having such a feature is all that important personally, but the question comes every so often and it
wouldbe nice to be able to point at the documentation for a definitive answer - not just one inferred from a lack of
documentation- especially since the observed behavior is that order is preserved today. 
>

That's a valid usecase, but adding such a guarantee in documentation
would restrict implementation. So at best we can say "no order is
guaranteed". But we write what's guaranteed. Anything not written in
the documents is not guaranteed.

There are ways to get it working, but let's not go into those details
in this thread.

--
Best Wishes,
Ashutosh Bapat



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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: Feature improvement for pg_stat_statements
Следующее
От: Amul Sul
Дата:
Сообщение: Re: [Patch] ALTER SYSTEM READ ONLY