Re: CommandStatus from insert returning when using a portal.

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: CommandStatus from insert returning when using a portal.
Дата
Msg-id CAKFQuwYioZVjVo-j57AWRScG6ics9E837ESGcksDYRJcP4wwXQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: CommandStatus from insert returning when using a portal.  (Chapman Flack <chap@anastigmatix.net>)
Ответы Re: CommandStatus from insert returning when using a portal.  (Chapman Flack <chap@anastigmatix.net>)
Список pgsql-hackers
On Fri, Jul 14, 2023 at 3:12 PM Chapman Flack <chap@anastigmatix.net> wrote:
If someone really does want to do a huge INSERT and get the generated
values back in increments, it might be clearer to write an explicit
INSERT RETURNING and issue it with executeQuery, where everything will
work as expected.


For PostgreSQL this is even moreso (i.e, huge means count > 1) since the order of rows in the returning clause is not promised to be related to the order of the rows as seen in the supplied insert command.  A manual insert returning should ask for not only any auto-generated column but also the set of columns that provide the unique natural key.

David J.

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

Предыдущее
От: Jacob Champion
Дата:
Сообщение: Re: pg_dump needs SELECT privileges on irrelevant extension table
Следующее
От: Chapman Flack
Дата:
Сообщение: Re: CommandStatus from insert returning when using a portal.