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

Re: Fix issuing of multiple command completions per command

From: Fernando Nasser <fnasser(at)redhat(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Fix issuing of multiple command completions per command
Date: 2002-02-27 18:59:07
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
Fernando Nasser wrote:
> Tom Lane wrote:
> >
> > 2. EndCommand should *not* be issued until we have completed all the
> > actions of the (rewritten) query.  Moving EndCommand into
> > PerformPortalFetch, as you did here, is exactly the wrong direction.
> > What we need is for EndCommand to be executed from pg_exec_query_string.
> > That means that the tag auxiliary info (currently set up by
> > UpdateCommandInfo) has to be passed out from ProcessQuery to
> > pg_exec_query_string, which is the only place that can know when to send
> > the command completion notice back to the client.
> >
> That was my first impression, but after I looked more deeply into it
> I figured that this is the right thing to do (I explain it below).
> And remember that there is still the 'Z'.  This completion will close
> the
> flow of data packets that may have been sent.  It is good for the
> async processing as well as the application may process the data
> while waiting for the 'Z' (otherwise it will not know that all the
> data has arrived).

OK, I take this back.  I see your point now.  We don't want async
processing to resume before all the extras_after are processed
because we want all these side effects to be perceived by whoever
is doing the processing.  So it doesn't matter that the data has
already arrived or not -- one has to wait.

It seems a small change though.  I believe I can safely let
pg_exec_query_string do all the EndCommand() calls.  I would just
have to add your suggested change to get the CommandInfo as well.
Let me know if you want me to try that.

Fernando Nasser
Red Hat Canada Ltd.                     E-Mail:  fnasser(at)redhat(dot)com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9

In response to


pgsql-patches by date

Next:From: Tom LaneDate: 2002-02-27 19:11:25
Subject: Re: Fix issuing of multiple command completions per command
Previous:From: Fernando NasserDate: 2002-02-27 14:30:05
Subject: Re: Patch to add CREATE OPERATOR CLASS

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