Re: CommandStatus from insert returning when using a portal.

Поиск
Список
Период
Сортировка
От Chapman Flack
Тема Re: CommandStatus from insert returning when using a portal.
Дата
Msg-id a0da38378cd9d986f1521280a81cf0f7@anastigmatix.net
обсуждение исходный текст
Ответ на Re: CommandStatus from insert returning when using a portal.  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-hackers
On 2023-07-14 18:22, David G. Johnston wrote:
> 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.

Yikes!

That sounds like something that (if it's feasible) the driver's
rewriting for RETURN_GENERATED_KEYS should try to do ... the
driver is already expected to be smart enough to know which
columns the generated keys are ... should it also try to rewrite
the query in some way to get a meaningful order of the results?

But then ... the apidoc for getGeneratedKeys is completely
silent on the ordering anyway. I get the feeling this whole
corner of the JDBC API may have been thought out only as far
as issuing a single-row INSERT at a time and getting its
assigned keys back.

Regards,
-Chap



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: CommandStatus from insert returning when using a portal.
Следующее
От: Nathan Bossart
Дата:
Сообщение: Re: Should we remove db_user_namespace?