Subject: Re: mprove tab completion for ALTER EXTENSION ADD/DROP

From: Kyotaro Horiguchi <[email-masked]>
Date: Wed, 11 Jan 2023 12:10:33 +0900 (JST)

At Mon, 2 Jan 2023 13:19:50 +0530, vignesh C <[email-masked]> wrote in 
> On Mon, 5 Dec 2022 at 06:53, Michael Paquier <[email-masked]> wrote:
> >
> > The DROP could be matched with the objects that are actually part of
> > the so-said extension?
> 
> The modified v2 version has the changes to handle the same. Sorry for
> the delay as I was working on another project.

It suggests the *kinds* of objects that are part of the extension, but
lists the objects of that kind regardless of dependency.  I read
Michael suggested (and I agree) to restrict the objects (not kinds) to
actually be a part of the extension. (And not for object kinds.)

However I'm not sure it is useful to restrict object kinds since the
operator already knows what to drop, if you still want to do that, the
use of completion_dont_quote looks ugly since the function
(requote_identifier) is assuming an identifier as input.  I didn't
looked closer but maybe we need another way to do that.

regards.

-- 
Kyotaro Horiguchi
NTT Open Source Software Center

---

From: Michael Paquier <[email-masked]>
Date: Wed, 11 Jan 2023 15:49:44 +0900

> actually be a part of the extension. (And not for object kinds.)

Yeah, that's what I meant.  Now, if Vignesh does not want to extend
that, that's fine for me as well at the end on second thought, as this 
involves much more code for each DROP path depending on the object
type involved.

Adding the object names after DROP/ADD is useful on its own, and we
already have some completion once the object type is specified, so
simpler is perhaps just better here.
--
Michael

---

From: vignesh C <[email-masked]>
Date: Wed, 11 Jan 2023 22:29:25 +0530

> simpler is perhaps just better here.

I too felt keeping it simpler is better. How about using the simple
first version of patch itself?

Regards,
Vignesh

---

From: Michael Paquier <[email-masked]>
Date: Thu, 12 Jan 2023 08:52:13 +0900

> first version of patch itself?

Okay, I have just done that, then, after checking that all the object
types were covered (28).  Note that PROCEDURAL LANGUAGE has been
removed for simplicity.
--
Michael