Re: CommandStatus from insert returning when using a portal.
От | Dave Cramer |
---|---|
Тема | Re: CommandStatus from insert returning when using a portal. |
Дата | |
Msg-id | CADK3HH+gDcwgGO6N=8MuGB8rtZ3MruQY1rVFJT+yE27H6pnLmQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: CommandStatus from insert returning when using a portal. (chap@anastigmatix.net) |
Ответы |
Re: CommandStatus from insert returning when using a portal.
Re: CommandStatus from insert returning when using a portal. |
Список | pgsql-hackers |
On Wed, 12 Jul 2023 at 20:00, <chap@anastigmatix.net> wrote:
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
Huh ... just how *is* PreparedStatement.execute() supposed
to behave when the statement is an INSERT RETURNING?
It's really executeUpdate which is supposed to return the number of rows updated.
Without a cursor it returns right away as all of the results are returned by the server. However with cursor you have to wait until you fetch the rows before you can get the CommandComplete message which btw is wrong as it returns INSERT 0 0 instead of INSERT 2 0
Dave
В списке pgsql-hackers по дате отправления: