Re: [HACKERS] psql tab completion for SELECT

2012-02-13 Thread Peter Eisentraut
On fre, 2012-02-10 at 01:24 -0500, Tom Lane wrote: > That seems pretty nearly entirely bogus. What is the argument for > supposing that the word right after SELECT is a function name? I would > think it would be a column name (from who-knows-what table) much more > often. That's what the patch d

Re: [HACKERS] psql tab completion for SELECT

2012-02-13 Thread Peter Eisentraut
On tor, 2012-02-09 at 23:02 +0100, Dimitri Fontaine wrote: > Peter Eisentraut writes: > > Make tab-completion complete also function names – like: SELECT > > pg_get to see all functions that start with pg_get. > > > > Make tab-completion work for columns in SELECT. I know that when writing > > SEL

Re: [HACKERS] psql tab completion for SELECT

2012-02-10 Thread Greg Sabino Mullane
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Robert Haas wrote: > 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. What we > really want to know is what kind of statement we're in and where we > are in it. Absent

Re: [HACKERS] psql tab completion for SELECT

2012-02-10 Thread Robert Haas
On Fri, Feb 10, 2012 at 11:22 AM, Tom Lane wrote: > Robert Haas writes: >> On Fri, Feb 10, 2012 at 11:01 AM, Tom Lane 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 th

Re: [HACKERS] psql tab completion for SELECT

2012-02-10 Thread Tom Lane
Robert Haas writes: > On Fri, Feb 10, 2012 at 11:01 AM, Tom Lane 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 l

Re: [HACKERS] psql tab completion for SELECT

2012-02-10 Thread Robert Haas
On Fri, Feb 10, 2012 at 11:01 AM, Tom Lane wrote: > Robert Haas writes: >> On Fri, Feb 10, 2012 at 10:20 AM, Tom Lane wrote: >>> I'm not against tab-completing functions, if people think that's >>> useful.  I am against tab-completing them in 1% of use-cases, which is >>> what this patch accompl

Re: [HACKERS] psql tab completion for SELECT

2012-02-10 Thread Tom Lane
Robert Haas writes: > On Fri, Feb 10, 2012 at 10:20 AM, Tom Lane wrote: >> I'm not against tab-completing functions, if people think that's >> useful.  I am against tab-completing them in 1% of use-cases, which is >> what this patch accomplishes.  The fact that it's short doesn't make it >> good.

Re: [HACKERS] psql tab completion for SELECT

2012-02-10 Thread Robert Haas
On Fri, Feb 10, 2012 at 10:20 AM, Tom Lane wrote: > Robert Haas writes: >> On Fri, Feb 10, 2012 at 1:24 AM, Tom Lane wrote: >>> That seems pretty nearly entirely bogus.  What is the argument for >>> supposing that the word right after SELECT is a function name? > >> It isn't necessarily, but it

Re: [HACKERS] psql tab completion for SELECT

2012-02-10 Thread Tom Lane
Robert Haas writes: > On Fri, Feb 10, 2012 at 1:24 AM, Tom Lane wrote: >> That seems pretty nearly entirely bogus. What is the argument for >> supposing that the word right after SELECT is a function name? > It isn't necessarily, but it might be. It'd certainly be nice to type: > SELECT pg_si

Re: [HACKERS] psql tab completion for SELECT

2012-02-10 Thread Benedikt Grundmann
On 10/02/12 08:50, Robert Haas wrote: > On Fri, Feb 10, 2012 at 1:24 AM, Tom Lane wrote: > > Peter Eisentraut writes: > >> That seems pretty useful, and it's more or less a one-line change, as in > >> the attached patch. > > > > That seems pretty nearly entirely bogus.  What is the argument for >

Re: [HACKERS] psql tab completion for SELECT

2012-02-10 Thread Pavel Stehule
2012/2/10 Robert Haas : > On Fri, Feb 10, 2012 at 1:24 AM, Tom Lane wrote: >> Peter Eisentraut writes: >>> That seems pretty useful, and it's more or less a one-line change, as in >>> the attached patch. >> >> That seems pretty nearly entirely bogus.  What is the argument for >> supposing that th

Re: [HACKERS] psql tab completion for SELECT

2012-02-10 Thread Robert Haas
On Fri, Feb 10, 2012 at 1:24 AM, Tom Lane wrote: > Peter Eisentraut writes: >> That seems pretty useful, and it's more or less a one-line change, as in >> the attached patch. > > That seems pretty nearly entirely bogus.  What is the argument for > supposing that the word right after SELECT is a f

Re: [HACKERS] psql tab completion for SELECT

2012-02-09 Thread Tom Lane
Peter Eisentraut writes: > That seems pretty useful, and it's more or less a one-line change, as in > the attached patch. That seems pretty nearly entirely bogus. What is the argument for supposing that the word right after SELECT is a function name? I would think it would be a column name (fro

Re: [HACKERS] psql tab completion for SELECT

2012-02-09 Thread Dimitri Fontaine
Peter Eisentraut writes: > Make tab-completion complete also function names – like: SELECT > pg_get to see all functions that start with pg_get. > > Make tab-completion work for columns in SELECT. I know that when writing > SELECT clause, psql doesn’t know which table it will deal with, but it > c

[HACKERS] psql tab completion for SELECT

2012-02-09 Thread Peter Eisentraut
In his blog entry http://www.depesz.com/2011/07/08/wish-list-for-psql/ depesz described a simple way to do tab completion for SELECT in psql: """ Make tab-completion complete also function names – like: SELECT pg_get to see all functions that start with pg_get. Make tab-completion work for column