Re: psql tab completion for SELECT

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, hubert depesz lubaczewski <depesz(at)depesz(dot)com>
Subject: Re: psql tab completion for SELECT
Date: 2012-02-10 16:23:50
Message-ID: CA+TgmobjCahHxkLZ=U=hB3hLG2ZoShX0E86EGxB70B3DV_5EUA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 10, 2012 at 11:22 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Fri, Feb 10, 2012 at 11:01 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> Well, if you want a patch with low standards, what about tab-completing
>>> function names anywhere that we do not see context suggesting something
>>> else?
>
>> I think that without a bit more contextual information that's likely
>> to lead to some odd results.  Unimplemented completions will lead to
>> bizarre things happening.
>
> True.  I was first thinking of doing this only if we know we're in
> a DML query, ie *first* word on the line is
> WITH/SELECT/INSERT/UPDATE/DELETE.  However, in the current
> implementation that is not terribly workable because we are only looking
> at the current line of text, not the whole input buffer; so making such
> a restriction would disable completion after the first line of a multi-
> line command.
>
>> One thing that's been bugging me for a while is that the tab
>> completion code all works by looking backward up to n words.
>
> Yup.  At the very least it would be good if it had access to the entire
> current command, so that we could sanity-check on the basis of the first
> word.

Agreed.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jean-Baptiste Quenot 2012-02-10 16:44:15 Fix PL/Python metadata when there is no result
Previous Message Tom Lane 2012-02-10 16:22:48 Re: psql tab completion for SELECT