Re: Add a tab-completion for "SELECT INTO" or "SELECT FROM" in psql - Mailing list pgsql-hackers

From Edmund Horner
Subject Re: Add a tab-completion for "SELECT INTO" or "SELECT FROM" in psql
Date
Msg-id CAMyN-kCw-9Cv3tCibikvko8ek+H4zjBSiW0wk8AT2BWNJKDA0Q@mail.gmail.com
Whole thread Raw
In response to Add a tab-completion for "SELECT INTO" or "SELECT FROM"in psql  ("C,C H" <a12321aabb@gmail.com>)
List pgsql-hackers
On 2 July 2018 at 17:57, C,C H <a12321aabb@gmail.com> wrote:
> I use tab-completion in psql quite often and I find that I can't complete
> "FROM" for SELECT query.
>
> So I try to create a patch for it.
>
> I download the source code from GitHub master branch and modify the file to
> create the patch.
>
> I compile the code and my code change works like follows,
> --------------------------------------------------------------
> postgres=# SELECT *  <Tab Key><Tab  Key>
> FROM  INTO
> postgres=# SELECT *
> --------------------------------------------------------------
>
>
> This is my first patch contribution trial here, please correct me if there
> is something wrong.

Hi CCHsu,

This looks useful, but it does overlap with my patch to add completion
for column and function names to SELECT -- see
https://commitfest.postgresql.org/18/1376/ .  I have been quiet on
this as everyone was (and still is) busy with the 11.0 release.

I also have a patch for columns and functions after a comma in the
select list, but I've been even more quiet on that one.

We can try to combine them.  It won't be as simple as your patch here,
unfortunately.  Luckily the completions are active at mostly*
different times.  Was the last word SELECT ?  Offer a column or
function name.  Otherwise offer FROM/INTO.

* note that FROM/INTO can also appear directly after SELECT!

Cheers,
Edmund


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: branches_of_interest.txt
Next
From: Masahiko Sawada
Date:
Subject: Re: Threat models for DB cryptography (Re: [Proposal] Table-levelTransparent Data Encryption (TDE) and Key) Management Service (KMS)