Re: [PATCH] Tab completion for ALTER DATABASE … SET TABLESPACE

Thomas Munro <thomas.munro@enterprisedb.com>

From: Thomas Munro <thomas.munro@enterprisedb.com>
To: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Arthur Zakirov <a.zakirov@postgrespro.ru>, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2018-09-21T08:23:55Z
Lists: pgsql-hackers

Attachments

On Fri, Sep 21, 2018 at 5:52 PM Andres Freund <andres@anarazel.de> wrote:
> Here's a very quick-and-dirty implementation of this approach. Some very
> very brief testing seems to indicate it works, although I'm sure not
> perfectly.
>
> The current duplication of the new functions doing the actual checking
> (like CheckMatchesFor(), CheckTailMatchesFor()) would probably need to
> be reduced. But I don't want to invest actual time before we decide that
> this could be something we'd actually want to pursue.

+1

And here is a quick-and-dirty variadic COMPLETE_WITH(...).  Together:

    else if (Matches("PREPARE", MatchAny, "AS"))
        COMPLETE_WITH("SELECT", "UPDATE", "INSERT", "DELETE FROM");

+ * Making C pretty by making it ugly again.

Heh.

-- 
Thomas Munro
http://www.enterprisedb.com

Commits

  1. Get rid of explicit argument-count markings in tab-complete.c.

  2. Fix psql's tab completion for ALTER DATABASE ... SET TABLESPACE.