Re: CommandStatus from insert returning when using a portal.

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: CommandStatus from insert returning when using a portal.
Дата
Msg-id CAKFQuwY8L5oRRRjcMSDfbBtP58QKw0EjMN+_UDogXcgAkur8yA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: CommandStatus from insert returning when using a portal.  (Dave Cramer <davecramer@gmail.com>)
Список pgsql-hackers
On Thu, Jul 13, 2023 at 6:07 PM Dave Cramer <davecramer@gmail.com> wrote:
On Thu, 13 Jul 2023 at 10:24, David G. Johnston <david.g.johnston@gmail.com> wrote:
On Thursday, July 13, 2023, Dave Cramer <davecramer@gmail.com> wrote:

Any comment on why the CommandComplete is incorrect ?
It returns INSERT 0 0  if a cursor is used

 Looking at DECLARE it is surprising that what you describe is even possible.  Can you share a psql reproducer?

apologies, we are using a portal, not a cursor. 


Still the same basic request of providing a reproducer - ideally in psql.

IIUC a portal has to be used for a prepared (extended query mode) result set returning query.  v16 can now handle parameter binding so:

postgres=# \bind 4
postgres=# insert into ins values ($1) returning id;
 id
----
  4
(1 row)

INSERT 0 1

Which gives the expected non-zero command tag row count result.

David J.

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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: PATCH: Using BRIN indexes for sorted output
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Allowing parallel-safe initplans