views are not auto completed on psql

Started by Jeff Postalmost 24 years ago3 messagesbugs
Jump to latest
#1Jeff Post
postjeff@uwm.edu

The best way that I can think to describe this is that views are not added
as candidates of possible line completions in psql.
So if I have a view with the name org_details and a table with the name
organizations and I try select * from org<TAB> the completion is
organizations not a list of organizations and org_details.

Thanks,
Jeff Post
postjeff@uwm.edu

#2Neil Conway
neilc@samurai.com
In reply to: Jeff Post (#1)
Re: views are not auto completed on psql

On Fri, 24 May 2002 17:16:28 -0700
"Jeff Post" <postjeff@uwm.edu> wrote:

The best way that I can think to describe this is that views are not added
as candidates of possible line completions in psql.
So if I have a view with the name org_details and a table with the name
organizations and I try select * from org<TAB> the completion is
organizations not a list of organizations and org_details.

On my end, that doesn't seem to be the case (running a build of CVS
that is few days old):

nconway=> create table organizations (a int);
CREATE TABLE
nconway=> create view org_details as select * from organizations;
CREATE VIEW
nconway=> select * from org<TAB>
org_details organizations

(where <TAB> represents hitting the tab key a couple times)

The query issued by psql is:

SELECT relname FROM pg_class WHERE (relkind='r' or relkind='v') and substr(relname,1,3)='org'

... which suggests to me that, at least for the common case, views are
supported for line completion.

Can you give us a reproducible test-case that demonstrates the problem?

Cheers,

Neil

--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Neil Conway (#2)
Re: views are not auto completed on psql

Neil Conway <nconway@klamath.dyndns.org> writes:

"Jeff Post" <postjeff@uwm.edu> wrote:

The best way that I can think to describe this is that views are not added
as candidates of possible line completions in psql.

On my end, that doesn't seem to be the case (running a build of CVS
that is few days old):

This seems to be a post-7.2 fix. In psql 7.2 the completion query only
looks for relkind = 'r'. Might be worth backpatching into the REL7_2
branch?

regards, tom lane