Shay Rojansky <roji@roji.org> writes:
>> Try adding a sync before the second execute.
> I tried inserting a Sync right before the second Execute, this caused an
> error with the message 'portal "MQ1" does not exist'.
> This seems like problematic behavior on its own, regardless of my issues
> here (Sync shouldn't be causing an implicit close of the portal, should
> it?).
Sync results in closing the transaction, if you've not explicitly executed
a BEGIN.
regards, tom lane