Re: \h tab-completion

From: Beena Emerson <memissemerson(at)gmail(dot)com>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: \h tab-completion
Date: 2017-01-25 06:03:56
Message-ID: CAOG9ApG=pKgcG2hDWTvNGG7TLp509wvtHi-5vssK=iSE1R4Tog@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 25, 2017 at 9:03 AM, Stephen Frost <sfrost(at)snowman(dot)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 Content-Type Size
tab-complete-hALTER.patch application/octet-stream 519 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-01-25 06:03:57 Re: [WIP] RE: DECLARE STATEMENT setting up a connection in ECPG
Previous Message Ideriha, Takeshi 2017-01-25 05:58:01 Re: [WIP] RE: DECLARE STATEMENT setting up a connection in ECPG