Question regarding Sync message and unnamed portal - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Question regarding Sync message and unnamed portal
Date
Msg-id 20120930.182637.1199893746953313328.t-ishii@sraoss.co.jp
Whole thread Raw
Responses Re: Question regarding Sync message and unnamed portal  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Question regarding Sync message and unnamed portal  (David Johnston <polobo@yahoo.com>)
List pgsql-hackers
From the manual:

"An unnamed portal is destroyed at the end of the transaction"

"At completion of each series of extended-query messages, the frontend
should issue a Sync message. This parameterless message causes the
backend to close the current transaction if it's not inside a
BEGIN/COMMIT transaction block"

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.

If this is true, that means unnamed portal execution and named portal
execution cannot be mixed unless they are inside an explicit
transaction. IMO this should be described in the document.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp



pgsql-hackers by date:

Previous
From: Darren Duncan
Date:
Subject: Re: is JSON really "a type" (Re: data to json enhancements)
Next
From: Kohei KaiGai
Date:
Subject: Re: 64-bit API for large object