Re: psql tabcomplete - minor bugfix - tabcomplete for SET ROLE TO xxx

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: hlinnaka(at)iki(dot)fi
Cc: Jeevan Chalke <jeevan(dot)chalke(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql tabcomplete - minor bugfix - tabcomplete for SET ROLE TO xxx
Date: 2015-07-08 12:50:37
Message-ID: CAFj8pRBWAFMHe-sVpPucW5wNzGjp1X=E2uEVN7WS3Kak0YzjEw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2015-07-02 11:03 GMT+02:00 Heikki Linnakangas <hlinnaka(at)iki(dot)fi>:

> On 05/29/2015 10:41 AM, Pavel Stehule wrote:
>
>> 2015-05-29 9:28 GMT+02:00 Jeevan Chalke <jeevan(dot)chalke(at)gmail(dot)com>:
>>
>> I agree with Peter that "We don't tab-complete everything we possibly
>>> could", but using tabs after "SET ROLE TO " provides "DEFAULT" as an
>>> option
>>> which seems wrong.
>>> This patch adds list of roles over there, which I guess good to have than
>>> giving something unusual.
>>>
>>> ...
>>
>> But back to this topic. I am thinking so it is little bit different due
>> fact so we support two very syntax for one feature. And looks little bit
>> strange, so one way is supported by autocomplete and second not.
>>
>
> Yeah, it's a bit strange. We have a specific autocomplete rule for "SET
> ROLE", but "SET ROLE TO" is treated as a generic GUC. With your patch, we'd
> also lose the auto-completion to "SET ROLE TO DEFAULT".
>
> I think we want to encourage people to use the SQL-standard syntax "SET
> ROLE ..." rather than the PostgreSQL-specific "SET ROLE TO ...". On the
> whole, this just doesn't seem like much of an improvement. I'll mark this
> as 'rejected' in the commitfest app.
>
> PS. I note that the auto-completion for "SET XXX TO ... is pretty lousy in
> general. We have rules for DateStyle, IntervalStyle, GEQO and search_path,
> but that's it. That could be expanded a lot. All enum-type GUCs could be
> handled with a single rule that queries pg_settings.enumvals, for example,
> and booleans would be easy too. But that's a different story.
>

I wrote a patch for fallback tabcomplete for bool and enum GUC variables

Regards

Pavel

>
> - Heikki
>
>

Attachment Content-Type Size
tabcomplete-fallback-bool-enum.patch text/x-patch 3.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-07-08 13:18:45 Re: New functions
Previous Message Дмитрий Воронин 2015-07-08 12:15:17 Re: New functions