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 pete...@gmx.net writes: Make tab-completion complete also function names – like: SELECT pg_gettabtab to see all functions that start with pg_get. Make tab-completion work for columns in SELECT. I know that when

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

Re: [HACKERS] psql tab completion for SELECT

2012-02-10 Thread Robert Haas
On Fri, Feb 10, 2012 at 1:24 AM, Tom Lane t...@sss.pgh.pa.us wrote: Peter Eisentraut pete...@gmx.net 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

Re: [HACKERS] psql tab completion for SELECT

2012-02-10 Thread Pavel Stehule
2012/2/10 Robert Haas robertmh...@gmail.com: On Fri, Feb 10, 2012 at 1:24 AM, Tom Lane t...@sss.pgh.pa.us wrote: Peter Eisentraut pete...@gmx.net 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.  

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 t...@sss.pgh.pa.us wrote: Peter Eisentraut pete...@gmx.net 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

Re: [HACKERS] psql tab completion for SELECT

2012-02-10 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Fri, Feb 10, 2012 at 1:24 AM, Tom Lane t...@sss.pgh.pa.us 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

Re: [HACKERS] psql tab completion for SELECT

2012-02-10 Thread Robert Haas
On Fri, Feb 10, 2012 at 10:20 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Fri, Feb 10, 2012 at 1:24 AM, Tom Lane t...@sss.pgh.pa.us wrote: That seems pretty nearly entirely bogus.  What is the argument for supposing that the word right after SELECT is a

Re: [HACKERS] psql tab completion for SELECT

2012-02-10 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Fri, Feb 10, 2012 at 10:20 AM, Tom Lane t...@sss.pgh.pa.us 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

Re: [HACKERS] psql tab completion for SELECT

2012-02-10 Thread Robert Haas
On Fri, Feb 10, 2012 at 11:01 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Fri, Feb 10, 2012 at 10:20 AM, Tom Lane t...@sss.pgh.pa.us wrote: I'm not against tab-completing functions, if people think that's useful.  I am against tab-completing them in 1%

Re: [HACKERS] psql tab completion for SELECT

2012-02-10 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Fri, Feb 10, 2012 at 11:01 AM, Tom Lane t...@sss.pgh.pa.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

Re: [HACKERS] psql tab completion for SELECT

2012-02-10 Thread Robert Haas
On Fri, Feb 10, 2012 at 11:22 AM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: On Fri, Feb 10, 2012 at 11:01 AM, Tom Lane t...@sss.pgh.pa.us wrote: Well, if you want a patch with low standards, what about tab-completing function names anywhere that we do not see

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

[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_gettabtab to see all functions that start with pg_get. Make tab-completion work for

Re: [HACKERS] psql tab completion for SELECT

2012-02-09 Thread Dimitri Fontaine
Peter Eisentraut pete...@gmx.net writes: Make tab-completion complete also function names – like: SELECT pg_gettabtab 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

Re: [HACKERS] psql tab completion for SELECT

2012-02-09 Thread Tom Lane
Peter Eisentraut pete...@gmx.net 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