Re: Speedup generation of command completion tags - Mailing list pgsql-hackers

From David Rowley
Subject Re: Speedup generation of command completion tags
Date
Msg-id CAApHDvqbTpcWeuvQVa9kS0TXtnoVc6i-brGJS=V-qDUnR3rgaw@mail.gmail.com
Whole thread Raw
In response to Re: Speedup generation of command completion tags  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-hackers
On Mon, 12 Dec 2022 at 14:48, David Rowley <dgrowleyml@gmail.com> wrote:
>
> On Sun, 11 Dec 2022 at 11:05, Andres Freund <andres@anarazel.de> wrote:
> > What about moving make_completion_tag() to cmdtag.c? Then we could just get
> > the entire CommandTagBehaviour struct at once. It's not super pretty to pass
> > QueryCompletion to a routine in cmdtag.c, but it's not awful. And if we deem
> > it problematic, we could just pass qc->commandTag, qc->nprocessed as a
> > separate arguments.
>
> That seems like a good idea. I've renamed and moved the function in
> the attached. I also adjusted how the trailing NUL char is appended to
> avoid having to calculate len + 1 and append the NUL char twice for
> the most commonly taken path.

I've pushed the updated patch. Thanks for having a look.

David



pgsql-hackers by date:

Previous
From: Paul Ramsey
Date:
Subject: Re: [PATCH] random_normal function
Next
From: Tom Lane
Date:
Subject: Re: Error-safe user functions