On Wed, Jan 25, 2017 at 9:03 AM, Stephen Frost <sfr...@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: tab-complete-hALTER.patch
Description: Binary data

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to