Re: psql tabcomplete - minor bugfix - tabcomplete for SET ROLE TO xxx - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: psql tabcomplete - minor bugfix - tabcomplete for SET ROLE TO xxx
Date
Msg-id CAFj8pRCz5w4tWZN3+6r_7TFJa_0YEgT4vLKidxecFA-C7CMtng@mail.gmail.com
Whole thread Raw
In response to Re: psql tabcomplete - minor bugfix - tabcomplete for SET ROLE TO xxx  (Andres Freund <andres@anarazel.de>)
Responses Re: psql tabcomplete - minor bugfix - tabcomplete for SET ROLE TO xxx  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers


2015-09-07 21:44 GMT+02:00 Andres Freund <andres@anarazel.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

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: On-demand running query plans using auto_explain and signals
Next
From: Thomas Munro
Date:
Subject: Re: Horizontal scalability/sharding