Extended queries

From: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Extended queries
Date: 2005-12-15 01:17:17
Message-ID: 20051215.101717.32718282.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2005-12-15 01:20:46 Re: Refactoring psql for backward-compatibility
Previous Message Hannu Krosing 2005-12-14 23:45:05 Re: Refactoring psql for backward-compatibility