Re: Several problems in tab-completions for SET/RESET

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Several problems in tab-completions for SET/RESET
Date: 2016-02-01 04:21:54
Message-ID: CAHGQGwFNKk_RBajobAr2UjEWSFi8JFEmtmatWn6O38vN==_uVA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 29, 2016 at 1:02 PM, Michael Paquier
<michael(dot)paquier(at)gmail(dot)com> wrote:
> On Fri, Jan 29, 2016 at 11:53 AM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>> I removed the above and added the following for that case.
>>
>> + /* Complete ALTER DATABASE|FUNCTION|ROLE|USER ... SET <name> */
>> + else if (Matches2("ALTER", "DATABASE|FUNCTION|ROLE|USER") &&
>> + TailMatches2("SET", MatchAny))
>> + COMPLETE_WITH_LIST2("FROM CURRENT", "TO");
>>
>> Attached is the updated version of the patch.

Thanks for the review!

> "ALTER FUNCTION foo(bar)" suggests OWNER TO, RENAME TO and SET SCHEMA.
> I think that we had better suggesting SET instead of SET SCHEMA, and
> add SCHEMA in the list of things suggested by SET.

Maybe, and it should suggest other keywords like RESET. That's it's better to
overhaul the tab-completion of ALTER FUNCTION. But that's not the task of
this patch. IMO it's better to fix that as a separate patch.

> "ALTER DATABASE foodb SET foo_param" should suggest TO/= but that's
> not the case. After adding TO/= manually, a list of values is
> suggested though. Same problem with ALTER ROLE and ALTER FUNCTION.

Fixed. Attached is the updated version of the patch.

Regards,

--
Fujii Masao

Attachment Content-Type Size
fix_tab_complete_for_set_v3.patch text/x-patch 2.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-02-01 04:53:53 Re: pglogical_output - a general purpose logical decoding output plugin
Previous Message Dilip Kumar 2016-02-01 04:05:56 Re: Move PinBuffer and UnpinBuffer to atomics