Re: [HACKERS] [BUGS] Autocomplete TAB on Postgres7.4beta5 not working?

2003-10-30 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes:
 2. include catalog objects in expansion iff we are expanding pg_ + 
 optional suffix (probably best of both worlds).

That seems like the best compromise position anyone offered, so I have
made the code work that way.

regards, tom lane

---(end of broadcast)---
TIP 8: explain analyze is your friend


Re: [HACKERS] [BUGS] Autocomplete TAB on Postgres7.4beta5 not working?

2003-10-28 Thread Andrew Dunstan
Tom Lane wrote:

Gaetano Mendola [EMAIL PROTECTED] writes:
 

I'm esperiencing problem with the TAB autocomplete on
postgres 7.4beta5:
   

 

#select * from pg_lTABTAB
and no suggestions out.
   

This appears to have been a deliberate change:

2003-03-27 11:45  momjian

* src/bin/psql/tab-complete.c: Attached are two patches for psql's
tab-completion.c.
   [snip]
Note that tables, indexes, views and sequences relations in the
'pg_catalog' namespace are excluded even though they are in the
current search path. I found not doing this produced annoying
behaviour when expanding names beginning with 'p'. People who work
with system tables a lot may not like this though; I can look for
another solution if necessary.

Ian Barwick
AFAICT there was no discussion about this issue when the patch was
proposed and applied.  But now that the point is raised I have to say
that I don't like this change.  I don't think system catalogs should be
excluded from tab completion.  They never were before 7.4, and I have
not seen anyone complaining about that, other than Ian.
Comments anyone?
 

Might be better to:

1. make it a settable option

and/or

2. include catalog objects in expansion iff we are expanding pg_ + 
optional suffix (probably best of both worlds).

I rarely use completion in this way so I could be an unrepresentative 
user, though :-)

cheers

andrew



---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
 joining column's datatypes do not match


Re: [HACKERS] [BUGS] Autocomplete TAB on Postgres7.4beta5 not working?

2003-10-28 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes:
 2. include catalog objects in expansion iff we are expanding pg_ + 
 optional suffix (probably best of both worlds).

Hmm, that might be an okay compromise.  Not sure how hard it is to
implement ...

regards, tom lane

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] [BUGS] Autocomplete TAB on Postgres7.4beta5 not working?

2003-10-28 Thread Tom Lane
Greg Stark [EMAIL PROTECTED] writes:
 I think I'm missing something. Why are pg_catalog.* tables in my search path
 at all? My search path seems to be set to $user,public. is pg_catalog
 implicitly appended there?

Yes.  See TFM:
http://developer.postgresql.org/docs/postgres/ddl-schemas.html
particularly section 5.8.5.

regards, tom lane

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [HACKERS] [BUGS] Autocomplete TAB on Postgres7.4beta5 not working?

2003-10-28 Thread Christopher Kings-Lynne

AFAICT there was no discussion about this issue when the patch was
proposed and applied.  But now that the point is raised I have to say
that I don't like this change.  I don't think system catalogs should be
excluded from tab completion.  They never were before 7.4, and I have
not seen anyone complaining about that, other than Ian.
Comments anyone?
I had noticed that, but I had gotten used to it.  I'm not fussed 
particularly either way, really...

Chris



---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [HACKERS] [BUGS] Autocomplete TAB on Postgres7.4beta5 not working?

2003-10-28 Thread Tom Lane
Alvaro Herrera Munoz [EMAIL PROTECTED] writes:
 I found it very irritating at first, but when I discovered that I could
 tab my way to syscatalogs by using pg_catalog. as prefix, I started
 feeling it was actually a nice behavior.

Hm.  Okay, Ian isn't completely alone then ;-)

I tried out that approach just now, though, and found that I still had
to type at least pg_c before I could get any tab completion help at
all.  Another odd thing was that after completing pg_catalog., it
wouldn't go any further --- one must type p here, even though all the
possible completions begin pg_.  (Possibly that could be fixed, but
I don't know readline's behavior well enough to be sure.)  So that's
five typed characters and two tabs before one starts getting into the
system catalogs.  That seems like a lot of typing.  If Ian were willing
to type one more character of his p-something table names before hitting
tab (I assume he's not calling them pg-something), then he'd not have a
problem with the availability of tab completion for system catalogs.
I think saving one keystroke for p-something user tables is a poor
return for requiring seven keystrokes for system catalogs.

Anyway, it seems like we need a vote to see how many people prefer
each choice.

regards, tom lane

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [HACKERS] [BUGS] Autocomplete TAB on Postgres7.4beta5 not working?

2003-10-28 Thread Joe Conway
Alvaro Herrera Munoz wrote:
On Tue, Oct 28, 2003 at 04:48:59PM -0500, Tom Lane wrote:
AFAICT there was no discussion about this issue when the patch was
proposed and applied.  But now that the point is raised I have to say
that I don't like this change.  I don't think system catalogs should be
excluded from tab completion.  They never were before 7.4, and I have
not seen anyone complaining about that, other than Ian.
I found it very irritating at first, but when I discovered that I could
tab my way to syscatalogs by using pg_catalog. as prefix, I started
feeling it was actually a nice behavior.
I found it similarly irritating at first, and it continues to irritate 
me. But that may be because I use system tables more frequently than the 
average Joe ;-)

I guess I'd be happy to see tab completion reinstated for system tables 
(except toast tables as Tom suggested nearby), but I don't feel 
particularly zealous about it.

Joe

---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?
  http://www.postgresql.org/docs/faqs/FAQ.html


Re: [HACKERS] [BUGS] Autocomplete TAB on Postgres7.4beta5 not working?

2003-10-28 Thread Ian Barwick
On Tuesday 28 October 2003 23:47, Tom Lane wrote:
 Alvaro Herrera Munoz [EMAIL PROTECTED] writes:
  I found it very irritating at first, but when I discovered that I could
  tab my way to syscatalogs by using pg_catalog. as prefix, I started
  feeling it was actually a nice behavior.

 Hm.  Okay, Ian isn't completely alone then ;-)

 I tried out that approach just now, though, and found that I still had
 to type at least pg_c before I could get any tab completion help at
 all.  Another odd thing was that after completing pg_catalog., it
 wouldn't go any further --- one must type p here, even though all the
 possible completions begin pg_.  (Possibly that could be fixed, but
 I don't know readline's behavior well enough to be sure.)  

I'm not sure whether it's intended or not, but explicitly adding
pg_catalog to the search path alleviates this.

 So that's
 five typed characters and two tabs before one starts getting into the
 system catalogs.  That seems like a lot of typing.  If Ian were willing
 to type one more character of his p-something table names before hitting
 tab (I assume he's not calling them pg-something),

Err ;-)

db= \d p
page_template_cache   pg_ts_cfg_pkey
page_template_cache_ov_idxpg_ts_cfgmap
page_template_cache_pkey  pg_ts_cfgmap_pkey
page_template_cache_template_idx  pg_ts_dict
pg_catalog.   pg_ts_dict_pkey
pg_temp_1.pg_ts_parser
pg_toast. pg_ts_parser_pkey
pg_ts_cfg public.

(The pg_ts_% are all from tsearch2 BTW. Though, they`re all in
a schema of their own so explicitly addressing them would
work equally well too).
 then he'd not have a
 problem with the availability of tab completion for system catalogs.

I'm sure I can live with that (one more character), at least until I finish
the brainwave input extension ;-).


Ian Barwick
[EMAIL PROTECTED]



---(end of broadcast)---
TIP 5: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faqs/FAQ.html


Re: [HACKERS] [BUGS] Autocomplete TAB on Postgres7.4beta5 not working?

2003-10-28 Thread Tom Lane
Gaetano Mendola [EMAIL PROTECTED] writes:
 I'm esperiencing problem with the TAB autocomplete on
 postgres 7.4beta5:

 #select * from pg_lTABTAB
 and no suggestions out.

This appears to have been a deliberate change:

2003-03-27 11:45  momjian

* src/bin/psql/tab-complete.c: Attached are two patches for psql's
tab-completion.c.
[snip]

Note that tables, indexes, views and sequences relations in the
'pg_catalog' namespace are excluded even though they are in the
current search path. I found not doing this produced annoying
behaviour when expanding names beginning with 'p'. People who work
with system tables a lot may not like this though; I can look for
another solution if necessary.

Ian Barwick

AFAICT there was no discussion about this issue when the patch was
proposed and applied.  But now that the point is raised I have to say
that I don't like this change.  I don't think system catalogs should be
excluded from tab completion.  They never were before 7.4, and I have
not seen anyone complaining about that, other than Ian.

Comments anyone?

regards, tom lane

---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


Re: [HACKERS] [BUGS] Autocomplete TAB on Postgres7.4beta5 not working?

2003-10-28 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes:
 Tom Lane wrote:
 AFAICT there was no discussion about this issue when the patch was
 proposed and applied.  But now that the point is raised I have to say
 that I don't like this change.  I don't think system catalogs should be
 excluded from tab completion.  They never were before 7.4, and I have
 not seen anyone complaining about that, other than Ian.
 
 Comments anyone?

 No one commented on it so it was applied --- now that we have two people
 who don't like it, seems we should back it out.

Not the whole patch, certainly, since it added a bunch of other good
stuff.  I just want to take out the discrimination against pg_catalog.
(BTW, the code also discriminates against pg_toast, but that part I
don't have a problem with.)

regards, tom lane

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] [BUGS] Autocomplete TAB on Postgres7.4beta5 not working?

2003-10-28 Thread Ian Barwick
On Tuesday 28 October 2003 22:48, Tom Lane wrote:

 AFAICT there was no discussion about this issue when the patch was
 proposed and applied.  But now that the point is raised I have to say
 that I don't like this change.  I don't think system catalogs should be
 excluded from tab completion.  They never were before 7.4, and I have
 not seen anyone complaining about that, other than Ian.

 Comments anyone?

Guilty as charged? ;-) 

Just to clarify, the patch enables tab completion for catalog relations
as long as the schema name pg_catalog is prepended. E.g.
\d pg_c[tab].[tab] will get expansion for everything in pg_catalog.

ISTR I found it very irritating that without this restriction
\d p[tab] produces a very large number of selections
for normal database work. Looking at a current database, I have about a
dozen of relations beginning with p in the search path which I access with tab
expansion frequently and I'm sure it would annoy me intensely if I got all the
system tables as well every time.

Mind you that's only my personal preference, I thought it might be unpopular
but as no one has commented since... I can submit a correction but not today
or tomorrow.


Ian Barwick
[EMAIL PROTECTED]

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly