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: 3C7D2C7B.DAE1CDDD@redhat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

Responses

Browse pgsql-patches by date

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