Re: Slow tab completion w/ lots of tables - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: Slow tab completion w/ lots of tables
Date
Msg-id 20120821172024.GJ1267@tamriel.snowman.net
Whole thread Raw
In response to Re: Slow tab completion w/ lots of tables  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: Slow tab completion w/ lots of tables
List pgsql-hackers
* Kevin Grittner (Kevin.Grittner@wicourts.gov) wrote:
> That already seems to work for me.

Ah, yes, that does..  I was using the query from tab-complete.c, which
wraps it in quote_ident(c.relanme), which ends up preventing us from
using the index.

There's a couple of other interesting corner cases, such as:

select * from "spa<tab>

Will return nothing, but:

select * from spa<tab>

Works just fine.

Similar, if you have a table called "TEST", then:

select * from "TE

works, but:

select * from TE
(or any other combo w/o a quote)

doesn't work.

Clearly, I'd be happier if we could use the index.  To be honest, I
think it'd also be nice if we could auto-quote tables (I've got quite a
few people who do things like create tables through ODBC, or migrate
from another DB where everything is all-uppercase, or mixed-case, and it
sure would be nice if those "just worked").  I'm not sure that there's
much use-case for asking people to prefix their table with a "- seems
more like a surprise that it's required than expected.

That said, I'm sure there are points to be made about how there'd be
problems with not requiring the ", or with things more complex than just
mixed-case situations.  Perhaps we need to go through and try to
enumerate what we want to happen in each situation and try to reach a
concensus (and a plan for how to implement it..).
Thanks,
    Stephen

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Slow tab completion w/ lots of tables
Next
From: Stephen Frost
Date:
Subject: Re: Slow tab completion w/ lots of tables