Re: patch: autocomplete for functions - Mailing list pgsql-hackers

From Josh Kupershmidt
Subject Re: patch: autocomplete for functions
Date
Msg-id CAK3UJRFtfje0KBZ-Lkhyz7Z5Nwg0WDSpqJ+bSp-fBOYWN+bzqg@mail.gmail.com
Whole thread Raw
In response to Re: patch: autocomplete for functions  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-hackers
On Mon, Mar 19, 2012 at 1:01 PM, Alvaro Herrera
<alvherre@commandprompt.com> wrote:

> I'm rather of the contrary opinion -- surely if we're going to complete
> function names, we should only complete those that are in schemas in the
> path; similarly for column names.

I think it makes sense to only include currently-visible functions,
but *not* only columns from currently visible tables, since we won't
know yet whether the user intends to schema-qualify the table name.

>  (BTW I didn't check but does this
> completion work if I schema-qualify a column name?)

Peter's proposed tab-completion only kicks in for the column-name
itself. Keep in mind, the user might be trying to enter: SELECT  schema.table.column ... SELECT  table.column ...
SELECT table_alias.column ... SELECT  column ... 

and presumably want to tab-complete the second token somehow. I'm a
bit leery about trying to tab-complete those first two, and the third
is right out. Just having the fourth would make me happy.

Josh


pgsql-hackers by date:

Previous
From: Josh Kupershmidt
Date:
Subject: Re: patch: autocomplete for functions
Next
From: Tom Lane
Date:
Subject: Re: Allow WAL information to recover corrupted pg_controldata