Re: Odd query execution behavior with extended protocol

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Odd query execution behavior with extended protocol
Дата
Msg-id 8155.1444169403@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Odd query execution behavior with extended protocol  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Odd query execution behavior with extended protocol  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Tue, Oct 6, 2015 at 5:53 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I dunno, if you close a portal before you've gotten CommandComplete,
>> should you expect that all its actions were taken?  Arguably, that
>> should be more like a ROLLBACK.

> I dunno either, but a rollback would undo everything, and a commit
> would do everything.  Ending up in a state where we've done some of it
> but not all of it is strange.  Being able to run an unbounded number
> of commands without a CommandCounterIncrement is *really* strange.

I'm fairly sure that we *have* done all of it; the Portal code is careful
to execute DML commands to completion whether or not the client accepts
all the RETURNING rows.  It will become visible after you commit.  The
issue here is just whether it's visible to a subsequent Bind within the
same transaction.

> I'm not very sure what to do about it, though.

Possibly we need the close-portal message processing code to do the CCI
stuff if it observes that the Portal hasn't been run to completion.
(I think there is already enough state in the Portal struct to tell that,
though I'm too lazy to look right now.)

I'm concerned though whether this would amount to a protocol break.
It's certainly a behavioral change that we'd have to document.
        regards, tom lane



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: pg_ctl/pg_rewind tests vs. slow AIX buildfarm members
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Odd query execution behavior with extended protocol