Re: Question regarding Sync message and unnamed portal

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Question regarding Sync message and unnamed portal
Дата
Msg-id 26489.1349021222@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Question regarding Sync message and unnamed portal  (Tatsuo Ishii <ishii@postgresql.org>)
Ответы Re: Question regarding Sync message and unnamed portal  (Tatsuo Ishii <ishii@postgresql.org>)
Список pgsql-hackers
Tatsuo Ishii <ishii@postgresql.org> writes:
> From the manual:
> "An unnamed portal is destroyed at the end of the transaction"

Actually, all portals are destroyed at end of transaction (unless
they're from holdable cursors).  Named or not doesn't enter into it.

> From these statements, I would think #4 will fail in the following
> sequence of commands because #3 closes transaction and it destroys
> unnamed portal: 1)Parse/Bind creates unnamed portal,
> 2)Parse/Bind/Execute creates named portal and executes, 3)Send Sync
> message (because it is required in extended protocol), 4)Execute
> unnamed portal created in #1.

The right thing to use if you're trying to interleave portal executions
like that is Flush, not Sync.  Sync mainly adds a protocol
resynchronization point --- it's needed in case portal execution fails
partway through.  (In which case you'll have lost both portals in the
transaction abort anyway.)
        regards, tom lane



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

Предыдущее
От: Thomas Munro
Дата:
Сообщение: pg_regress running for ~10 hours using 100% CPU
Следующее
От: Tom Lane
Дата:
Сообщение: Re: embedded list v3