Re: [HACKERS] \h tab-completion - Mailing list pgsql-hackers

From Beena Emerson
Subject Re: [HACKERS] \h tab-completion
Date
Msg-id CAOG9ApG=pKgcG2hDWTvNGG7TLp509wvtHi-5vssK=iSE1R4Tog@mail.gmail.com
Whole thread Raw
In response to [HACKERS] \h tab-completion  (Stephen Frost <sfrost@snowman.net>)
Responses Re: [HACKERS] \h tab-completion  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers


On Wed, Jan 25, 2017 at 9:03 AM, Stephen Frost <sfrost@snowman.net> wrote:
All,

I'm not really inclined to do it myself right now, but it'd be awful
nice if we had better table completion for \h.

Right now, '\h alter<tab>' returns nothing, and '\h alter' returns a
*bunch* of stuff.

Yet, we happily support '\h alter view' and friends, returning just the
info relevant for that particular command.

This would be a good starter project for someone new to work on, imv,
tho it could also go on the to-do list.

Thanks!



I think the following change in tab-complete.c would do the trick.

-       else if (Matches1("ALTER"))
+       else if (TailMatches1("ALTER")) 


postgres=# \h ALTER
AGGREGATE             DOMAIN                FUNCTION              MATERIALIZED VIEW     RULE                  SYSTEM                TYPE
COLLATION             EVENT TRIGGER         GROUP                 OPERATOR              SCHEMA                TABLE                 USER
CONVERSION            EXTENSION             INDEX                 POLICY                SEQUENCE              TABLESPACE            USER MAPPING FOR
DATABASE              FOREIGN DATA WRAPPER  LANGUAGE              PUBLICATION           SERVER                TEXT SEARCH           VIEW
DEFAULT PRIVILEGES    FOREIGN TABLE         LARGE OBJECT          ROLE                  SUBSCRIPTION          TRIGGER


--
Thank you, 

Beena Emerson

Have a Great Day!
Attachment

pgsql-hackers by date:

Previous
From: "Ideriha, Takeshi"
Date:
Subject: Re: [WIP] RE: [HACKERS] DECLARE STATEMENT setting up a connectionin ECPG
Next
From: Michael Paquier
Date:
Subject: Re: [WIP] RE: [HACKERS] DECLARE STATEMENT setting up a connection in ECPG