Re: CommandStatus from insert returning when using a portal.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: CommandStatus from insert returning when using a portal.
Дата
Msg-id 2748473.1689198563@sss.pgh.pa.us
обсуждение исходный текст
Ответ на CommandStatus from insert returning when using a portal.  (Dave Cramer <davecramer@gmail.com>)
Ответы Re: CommandStatus from insert returning when using a portal.  (Dave Cramer <davecramer@gmail.com>)
Re: CommandStatus from insert returning when using a portal.  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-hackers
Dave Cramer <davecramer@gmail.com> writes:
> Obviously I am biased by the JDBC API which would like to have
> PreparedStatement.execute() return the number of rows inserted
> without having to wait to read all of the rows returned

Umm ... you do realize that we return the rows on-the-fly?
The server does not know how many rows got inserted/returned
until it's run the query to completion, at which point all
the data has already been sent to the client.  There isn't
any way to return the rowcount before the data, and it wouldn't
be some trivial protocol adjustment to make that work differently.
(What it *would* be is expensive, because we'd have to store
those rows somewhere.)

            regards, tom lane



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

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: CommandStatus from insert returning when using a portal.
Следующее
От: Dave Cramer
Дата:
Сообщение: Re: CommandStatus from insert returning when using a portal.