I liked the new tab competion ability in psql.  Seems to work well in
CREATE * but not so great in the others, like doing FROM and WHERE.  Can
you take a look at backend/parser/keywords.c and see if you can merge
completion for those words in to psql.  It may be a nice feature.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Tue, 30 Nov 1999 12:22:00 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
tab completion in psql
On Tue, 30 Nov 1999, Bruce Momjian wrote:

> I liked the new tab competion ability in psql.  Seems to work well in
> CREATE * but not so great in the others, like doing FROM and WHERE.  Can
> you take a look at backend/parser/keywords.c and see if you can merge
> completion for those words in to psql.  It may be a nice feature.

The tab completion is not very smart, it only covers the really obvious
cases. Doing FROM shouldn't be so hard, but once you get into WHERE you
almost end up writing a complete SQL parser just for this. Not that
there's anything fundamentally wrong with that. It's a very evolving piece
of code, however; it can only get better. I bet those readline authors
never had this one in mind. Otherwise readline would play nicer with it.

-- 
Peter Eisentraut                  Sernanders vaeg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden


Tue, 30 Nov 1999 18:41:36 +0100 (MET)
Peter Eisentraut <e99re41@DoCS.UU.SE>
Re: tab completion in psql
> On Tue, 30 Nov 1999, Bruce Momjian wrote:
> 
> > I liked the new tab competion ability in psql.  Seems to work well in
> > CREATE * but not so great in the others, like doing FROM and WHERE.  Can
> > you take a look at backend/parser/keywords.c and see if you can merge
> > completion for those words in to psql.  It may be a nice feature.
> 
> The tab completion is not very smart, it only covers the really obvious
> cases. Doing FROM shouldn't be so hard, but once you get into WHERE you
> almost end up writing a complete SQL parser just for this. Not that
> there's anything fundamentally wrong with that. It's a very evolving piece
> of code, however; it can only get better. I bet those readline authors
> never had this one in mind. Otherwise readline would play nicer with it.

I am just suggesting completing the word FROM, not doing anything more
than that.

-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Tue, 30 Nov 1999 12:55:02 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: tab completion in psql
Then Peter Eisentraut <e99re41@DoCS.UU.SE> spoke up and said:
> The tab completion is not very smart, it only covers the really obvious
> cases. Doing FROM shouldn't be so hard, but once you get into WHERE you
> almost end up writing a complete SQL parser just for this. Not that
> there's anything fundamentally wrong with that. It's a very evolving piece
> of code, however; it can only get better. I bet those readline authors
> never had this one in mind. Otherwise readline would play nicer with it.

I've used Python's readline support, and I must say it's really nice
when the readline engine can complete more dynamic names.  It would be
very nice if "\d table" or "\dt" populated a dictionary of some kind
which could then be used for completion.  While context sensitivity
would be even better, it might be worthwhile to simply have a dynamic
dictionary. 

-- 
=====================================================================
| JAVA must have been developed in the wilds of West Virginia.      |
| After all, why else would it support only single inheritance??    |
=====================================================================
| Finger geek@cmu.edu for my public key.                            |
=====================================================================
30 Nov 1999 13:49:24 -0500
Brian E Gallew <geek+@cmu.edu>
Re: [HACKERS] Re: tab completion in psql