Обсуждение: tab completion in psql

Поиск
Список
Период
Сортировка

tab completion in psql

От
Bruce Momjian
Дата:
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,
Pennsylvania19026
 


Re: tab completion in psql

От
Peter Eisentraut
Дата:
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



Re: tab completion in psql

От
Bruce Momjian
Дата:
> 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,
Pennsylvania19026
 


Re: [HACKERS] Re: tab completion in psql

От
Brian E Gallew
Дата:
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.                            |
=====================================================================