Re: Extended queries - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Extended queries
Date
Msg-id 9970.1134624692@sss.pgh.pa.us
Whole thread Raw
In response to Extended queries  (Tatsuo Ishii <ishii@sraoss.co.jp>)
Responses Re: Extended queries  (Tatsuo Ishii <ishii@sraoss.co.jp>)
List pgsql-hackers
Tatsuo Ishii <ishii@sraoss.co.jp> writes:
> 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).

If you can demonstrate that this is not so, I'd like to see it.

> A workaround I found so far was issuing "Flush" immediately after
> "Execute".

This seems to indicate that you may be confused about the difference
between "backend responds with message xyz" and "message xyz will be
immediately delivered to the client".  In *all* cases, you should send
either Flush or Sync before waiting for a backend response, because
only those message types force the backend output buffer to be flushed.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Self-modifying code
Next
From: Tom Lane
Date:
Subject: Re: 7.3 failure on platypus