Extended queries - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Extended queries
Date
Msg-id 20051215.101717.32718282.t-ishii@sraoss.co.jp
Whole thread Raw
Responses Re: Extended queries  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

I have difficulties with extended queries and pgpool combo.

the background:

After sending a query to the backend, pgpool waits for a response from
the backend so that pgpool can make sure that the query
completes. This is necessary since pgpool needs to keep the order of
SQL commands (especially which cause some locking), first master then
secondary to avoid a deadlock.

the problem:

a "simple query" returns CommandComplete(or ErrorResponse etc.) after
completing the query. So far no problem.

However a extended query "Execute" does not return CommandComplete
(note: ErrorResponse will be returned if an error occurs). Although
the doc says " Therefore, an Execute phase is always terminated by the
appearance of exactly one of these messages: CommandComplete,
EmptyQueryResponse (if the portal was created from an empty query
string), ErrorResponse, or PortalSuspended", I don't think the
description is quite correct from observing the actual implementation
(or the implementation is wrong).

A workaround I found so far was issuing "Flush" immediately after
"Execute". I'm not sure if this is the correct solution, but I
couldn't find any better way.

Suggestions?
--
Tatsuo Ishii
SRA OSS, Inc. Japan


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: Refactoring psql for backward-compatibility
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: Refactoring psql for backward-compatibility