Re: Guidance on INSERT RETURNING order

Поиск
Список
Период
Сортировка
От Federico
Тема Re: Guidance on INSERT RETURNING order
Дата
Msg-id CAN19dyfhqBhsiDDUyQCAyjm_OC=SMo+wGrE7W84RiJOvAPCr7g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Guidance on INSERT RETURNING order  (Thorsten Glaser <tg@evolvis.org>)
Ответы Re: Guidance on INSERT RETURNING order  (Thorsten Glaser <tg@evolvis.org>)
Список pgsql-general
On Tue, 11 Apr 2023 at 23:22, Thorsten Glaser <tg@evolvis.org> wrote:
>
> On Tue, 11 Apr 2023, Federico wrote:
>
> >Of course sorting the returned ids is only viable when using a serial
>
> Yes, which is why I pointed out it doesn’t have to be.
>
> >or identity column, that's why in the general case I've mentioned the
> >insert with sentinel column
>
> But it was pointed out that that’s not guaranteed either, unless you add
> that sentinel column to the table itself…

I was under the impression that when using INSERT SELECT ORDER BY the sequence
ids were generated using the select order.
That has been mentioned in multiple other previous messages, like
https://www.postgresql.org/message-id/29386.1528813619%40sss.pgh.pa.us

The above does not cover all cases, but in practice serial or identity
are very common,
so it would be nice if at least in these cases a sentinel is not needed

Thanks,
  Federico

> bye,
> //mirabilos
> --
> 15:41⎜<Lo-lan-do:#fusionforge> Somebody write a testsuite for helloworld :-)
>
>
>
>



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

Предыдущее
От: Rob Sargent
Дата:
Сообщение: Re: Guidance on INSERT RETURNING order
Следующее
От: Federico
Дата:
Сообщение: Re: Guidance on INSERT RETURNING order