[pgpool-general: 8936] Re: Server-side cursors using Declare/Describe do not work in pgpool-ii

Tatsuo Ishii ishii at sraoss.co.jp
Wed Sep 27 11:48:11 JST 2023


> Thank you for the report. I think your analysis is correct. Pgpool-II
> needs to be fixed.
> 
>> I'd think that fixing this would either involve tracking DECLARE
>> statements like other portal statements, or passing the message to the
>> primary to let it handle the Describe on its own.
> 
> The latter looks simple but I need to investigate more.
> 
>> Let me know if there is anything I can do to help!
> 
> Thanks in advance,

F.Y.I.
Attached is the minimum test case for pgproto (a protocol level test
tool included in the pgpool distribution). As you can see, pgpool
raises an error, while PosthreSQL case (2) replies RowDescription
message as expected.

(1) via pgpool case

$ pgproto -p 11000 -d test -f /usr/local/src/pgsql/current/RefCursor/pgproto.data 
FE=> Query (query="BEGIN")
<= BE CommandComplete(BEGIN)
<= BE ReadyForQuery(T)
FE=> Parse(stmt="", query="DECLARE "serverside-cursor-broken" NO SCROLL CURSOR FOR SELECT 3")
FE=> Bind(stmt="", portal="")
FE=> Execute(portal="")
FE=> Describe(portal="serverside-cursor-broken")
FE=> Sync
FE=> Query (query="END")
<= BE ErrorResponse(S FATAL C XX000 M unable to execute Describe D unable to get the bind message F pool_proto_modules.c L 1788 )
read_it: EOF detected

(2) Directly connected to PostgreSQL case

$ pgproto -p 11002 -d test -f /usr/local/src/pgsql/current/RefCursor/pgproto.data 
FE=> Query (query="BEGIN")
<= BE CommandComplete(BEGIN)
<= BE ReadyForQuery(T)
FE=> Parse(stmt="", query="DECLARE "serverside-cursor-broken" NO SCROLL CURSOR FOR SELECT 3")
FE=> Bind(stmt="", portal="")
FE=> Execute(portal="")
FE=> Describe(portal="serverside-cursor-broken")
FE=> Sync
FE=> Query (query="END")
<= BE ParseComplete
<= BE BindComplete
<= BE CommandComplete(DECLARE CURSOR)
<= BE RowDescription
<= BE ReadyForQuery(T)

Best reagards,
--
Tatsuo Ishii
SRA OSS LLC
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp
-------------- next part --------------
'Q'	"BEGIN"
'Y'
'P'	""	"DECLARE "serverside-cursor-broken" NO SCROLL CURSOR FOR SELECT 3"	0
'B'	""	""	0	0	0
'E'	""	0
'D'	'P'	"serverside-cursor-broken"
'S'
'Q'	"END"
'Y'


More information about the pgpool-general mailing list