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

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема Re: Several problems in tab-completions for SET/RESET
Дата
Msg-id CAHGQGwFo--wp9NQMxd53uaaUkEkvzJ9RBRa81yAjH+HfSMb1wg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Several problems in tab-completions for SET/RESET  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: Several problems in tab-completions for SET/RESET  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
On Mon, Feb 1, 2016 at 3:14 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> On Mon, Feb 1, 2016 at 1:21 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
>> On Fri, Jan 29, 2016 at 1:02 PM, Michael Paquier
>> <michael.paquier@gmail.com> wrote:
>>> On Fri, Jan 29, 2016 at 11:53 AM, Fujii Masao <masao.fujii@gmail.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.
>
> Er, OK... I thought that both problems seem rather linked per the
> $subject but I can send an extra patch on this thread if necessary.
> Never mind.
>
>>> "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.
>
> +       /* Complete ALTER DATABASE|FUNCTION|ROLE|USER ... SET <name> */
> +       else if (HeadMatches2("ALTER", "DATABASE|FUNCTION|ROLE|USER") &&
> +                        TailMatches2("SET", MatchAny))
> +               COMPLETE_WITH_LIST2("FROM CURRENT", "TO");
> Small thing: adding "=" to the list of things that can be completed?

If we do that, we also should change the tab-completion for SET command
so that "=" is suggested. But I'm afraid that which might decrease that
tab-completion.

Imagine the case of "SET work_mem <tab>". If "TO" and "=" are suggested,
we need to type either "T" or "=" and then <tab> to input the setting value.
Otherwise, "SET work_mem <tab>" suggests only "TO" and we can input
the setting value by just typing <tab> again.
This extra step is very small, but SET command is usually used very often,
so I'd like to avoid such extra step.

Regards,

-- 
Fujii Masao



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Vitaly Burovoy
Дата:
Сообщение: Re: Patch: make behavior of all versions of the "isinf" function be similar
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Template for commit messages