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

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, 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-09-08 05:06:04
Message-ID: CAFj8pRCz5w4tWZN3+6r_7TFJa_0YEgT4vLKidxecFA-C7CMtng@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2015-09-07 21:44 GMT+02:00 Andres Freund <andres(at)anarazel(dot)de>:

> Hi,
>
> On 2015-09-02 22:58:21 +0200, Pavel Stehule wrote:
> > > Won't that mean that enum variables don't complete to default anymore?
>
> > no, it does
> >
> > #define Query_for_enum \
> > " SELECT name FROM ( "\
> > " SELECT unnest(enumvals) AS name "\
> > " FROM pg_catalog.pg_settings "\
> > " WHERE pg_catalog.lower(name)=pg_catalog.lower('%s') "\
> > " UNION SELECT 'DEFAULT' ) ss "\
> > ****************
> > " WHERE pg_catalog.substring(name,1,%%d)='%%s'"
>
> Ah.
>
> I've added a quote_ident() around unnest() - otherwise the
> auto-completions for default_transaction_isolation will mostly be wrong
> due to spaces.
>
> I also renamed get_vartype into get_guctype, changed the comment as I
> found the reference to the pg type system confusing, and more
> importantly made it not return a static buffer.
>
> The spellings for boolean values were a relatively small subset of what
> the backend accepts - it's now on,off,true,false,yes,no,1,0. I'm not
> sure whether that's a good idea. Comments?
>

if somebody prefer true, false, and we will support only on, off, then the
tabcomplete will not be too user friendly :(

"1, 0" can be out - but other?

>
> Andres
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2015-09-08 06:25:00 Re: Horizontal scalability/sharding
Previous Message Pavel Stehule 2015-09-08 04:58:37 Re: On-demand running query plans using auto_explain and signals