Re: Getting sequence-generated IDs from multiple row insert

Поиск
Список
Период
Сортировка
От Andrew Sullivan
Тема Re: Getting sequence-generated IDs from multiple row insert
Дата
Msg-id 20140331211041.GG54796@crankycanuck.ca
обсуждение исходный текст
Ответ на Re: Getting sequence-generated IDs from multiple row insert  (David Johnston <polobo@yahoo.com>)
Список pgsql-general
On Mon, Mar 31, 2014 at 01:34:04PM -0700, David Johnston wrote:
>
> If order is an implicit property of the source data then you need to
> explicitly encode that order during (or before) import.

Sure, but the problem the OP had I thought was that the RETURNING
clause doesn't guarantee that the rows coming back are in the order
they were inserted.  This is just a SQL thing.  (I guess you could
ORDER BY the RETURNING clause, right?)

> There are numerous
> ways to implement such but except for extremely simple cases PostgreSQL will
> not do the appropriate thing automatically in the face of concurrency.

It _is_ doing the appropriate thing, though: this is SQL.  The rows
aren't ordered unless you tell them to be.

A

--
Andrew Sullivan
ajs@crankycanuck.ca


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

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: Why does "checkpointer" is consumig ~1.2Gb of RAM?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Wanted: ALTER TRIGGER ... OWNED BY EXTENSION