Re: Improved tab completion for FDW DDL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Improved tab completion for FDW DDL
Date
Msg-id 11619.1452177205@sss.pgh.pa.us
Whole thread Raw
In response to Re: Improved tab completion for FDW DDL  (Andreas Karlsson <andreas@proxel.se>)
List pgsql-hackers
Andreas Karlsson <andreas@proxel.se> writes:
> On 01/04/2016 01:09 AM, David Fetter wrote:
>> On Wed, Dec 30, 2015 at 01:21:06PM +0100, Andreas Karlsson wrote:
>>> Another completion which is currently missing but I am not sure if we should
>>> add or not is completing "ALTER|CREATE|DROP USER" with "MAPPING FOR", but
>>> since it might interfere with completing to username for "ALTER|DROP USER" I
>>> am not sure we want it. What do you think?

>> Is there a way to require some reasonable chunk--say, one that's
>> disambiguated from the name any known ROLE with LOGIN--of MAPPING
>> before completing with MAPPING FOR?  I confess to not knowing how the
>> new system works in enough detail to know that off the top of my head.

> No, and while it would not be too hard to build it would not be worth 
> doing just for this use case.

The way we've solved other similar cases would translate like this:
instead of the "query for user names" just returning user names, add
on "UNION 'MAPPING FOR'".  So if you do

# alter user <TAB>

where you're now offered

alice    joe       postgres

you'd instead get

alice    joe       postgres    MAPPING FOR

Dunno if it's worth the trouble though.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: checkpointer continuous flushing
Next
From: Jim Nasby
Date:
Subject: Re: Very confusing installcheck behavior with PGXS