Re: tab completion for setting search_path

From: Christoph Berg <cb(at)df7cb(dot)de>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: tab completion for setting search_path
Date: 2014-07-14 19:20:18
Message-ID: 20140714192018.GE14198@msg.df7cb.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Re: Andres Freund 2014-07-12 <20140712135128(dot)GD3494(at)awork2(dot)anarazel(dot)de>
> I'm also not really happy with the fact that we only complete a single
> search_path item. But it's not easy to do better and when looking around
> other places (e.g. DROP TABLE) don't support it either.

The difference is that the other places don't really need it, i.e. you
can just issue two DROP TABLE. (And I wasn't even aware that DROP
TABLE a, b; exists specifically).

That said, it's great to have the feature, though I'd say making
search_path list-aware should be much higher on the todo list than a
generic solution for other cases.

> I've thought about adding "$user" to the set of completed things as

If we only support one item atm, $user isn't very relevant anyway.

> Fujii wondered about it, but it turns out completions containing $ don't
> work really great because $ is part of WORD_BREAKS.
> E.g. check out what happens if you do
> CREATE TABLE "foo$01"();
> CREATE TABLE "foo$02"();
> DROP TABLE "foo$<tab>
> which means that a single schema that requires quoting will break
> completion of "$user".

Schemas requiring quoting should be rare, so that wouldn't be a big
problem. (Or at least it could solve the problem for most users.)

Christoph
--
cb(at)df7cb(dot)de | http://www.df7cb.de/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-07-14 19:40:33 Re: Pg_upgrade and toast tables bug discovered
Previous Message Christoph Berg 2014-07-14 18:59:49 Re: Securing "make check" (CVE-2014-0067)