psql auto-completion for multiple where clauses

From: Thom Brown <thombrown(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: psql auto-completion for multiple where clauses
Date: 2010-07-16 14:42:55
Message-ID: AANLkTinOdp9x0ac8NxuXayDwU4mbqFfInzXBTYkCAPbk@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Someone highlighed on IRC that after the first WHERE clause,
autocomplete no longer works.

An example:

CREATE TABLE tab_completion (
id serial,
stuff text,
meow boolean
);

SELECT * FROM tab_completion WHERE id = 2 AND s<tab><tab>

This would output a blank line.

Is there any chance of improving this so it would work for more than 1
WHERE clause? I notice it also doesn't work for GROUP BY or HAVING at
all, but seems to be fine for ORDER BY.

While we're at it, how about a smarter auto-complete for
quote-required column names (or whichever term I was supposed to use
just then):

CREATE TABLE tab_completion (
id serial,
stuff text,
"bark bark" boolean
);

SELECT * FROM tab_completion WHERE id = 2 AND b<tab>

Since there is no column beginning with "b", it might be an idea to
get it to match "bark bark" instead. It might help alleviate what may
be a gotcha for some.

Thanks

Thom

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-07-16 14:43:16 Re: dividing money by money
Previous Message Tom Lane 2010-07-16 14:36:48 Re: dividing money by money