Skip site navigation (1) Skip section navigation (2)

Re: pgin.tcl pg_exec_prepared slow (was: Released...)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: L J Bayuk <ljb220(at)mindspring(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: pgin.tcl pg_exec_prepared slow (was: Released...)
Date: 2004-07-10 00:07:56
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
L J Bayuk <ljb220(at)mindspring(dot)com> writes:
> I just haven't decided
> whether to flush before reading, or flush after all messages that need a
> response (I think: Startup, PasswordMessage, Query, Sync, CopyDone, and
> FunctionCall are the ones I use).

You seem to have quite missed my point.  If you decide to flush on the
basis of flush-after-certain-message-types-are-sent, then the types to
flush after are precisely Sync and Flush.  If you think you want
something different, you are wrong and should think again (or more
likely, insert Flush messages into the outgoing stream at the places
where you want a flush to occur).  There is no point in flushing after
any other message type because the backend won't flush its response.

Of course this is all moot if you choose to flush just before waiting
for input (though you'd still better be sure that Flush or Sync was the
last message sent before you do so).

> I could not find the described flush "when control returns to the main
> loop". Either I'm missing it, or it isn't there, and the comment implies
> that it may have been there at one time.

It's actually in ReadyForQuery() these days.

			regards, tom lane

In response to


pgsql-interfaces by date

Next:From: L J BayukDate: 2004-07-12 01:33:04
Subject: Re: pgin.tcl pg_exec_prepared slow (was: Released...)
Previous:From: Jim ButtafuocoDate: 2004-07-08 18:58:54
Subject: Re: [Fwd: typlen field in the pg_type table]

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group