Re: CREATE tab completion

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: michael(at)paquier(dot)xyz
Cc: katouknl(at)oss(dot)nttdata(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: CREATE tab completion
Date: 2021-11-18 08:20:58
Message-ID: 20211118.172058.244719626914306841.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Thu, 18 Nov 2021 17:17:25 +0900, Michael Paquier <michael(at)paquier(dot)xyz> wrote in
> On Thu, Nov 18, 2021 at 04:25:30PM +0900, Ken Kato wrote:
> > For this part, I did the following:
> > + else if (TailMatches("CREATE", "SEQUENCE", MatchAny, "AS") ||
> > + TailMatches("CREATE", "TEMP|TEMPORARY", "SEQUENCE", MatchAny, "AS"))
> > + COMPLETE_WITH("smallint", "integer", "bigint");
> >
> > Am I doing this right? or Are there better ways to do it?
>
> That looks fine per se.

FWIW, I would be a bit perplexed to see type names suggested in
upper-cases, even if it is acceptable by the parser. If you type-in
the following phrase:

=# type boo<tab>

it is completed to "boolean" but,

=# type BOO<tab>

doesn't respond.

So we could use COMPLETE_WITH_CS instead so that CREATE SEQUENCE
behavess the same way with the existing behavior of TYPE.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2021-11-18 08:21:47 Re: pg_waldump stucks with options --follow or -f and --stats or -z
Previous Message Michael Paquier 2021-11-18 08:17:25 Re: CREATE tab completion