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 20120821182352.GM1267@tamriel.snowman.net
Whole thread Raw
In response to Re: Slow tab completion w/ lots of tables  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom,

* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Um, I don't believe we do any case-insensitive search now, do we?

No, I don't suppose we do..  I was thinking we ran quote_ident() on the
search-string side, but apparently we don't, meaning:

select * from TE<tab>

doesn't find 'test'.  I suppose it's alright to keep it that way.

> > We'd essentially do: LIKE 'xx%', and then run quote_ident() on the
> > result (I assume we can replace the whole word, right?).  I'd also
> > strip off any ", for the purposes of searching with tab-completion.
>
> I think you might be saying the same thing I said in my prior message,
> but not quite sure.

You added the distinction that we have to watch out for embedded quotes.
Otherwise, I believe we had the same approach, which is to strip off a
leading quote, if there is one, and then compare the raw string directly
to relname using: LIKE 'xxx%';  If there is an embedded quote, go back
to using quote_ident and matching the whole string.
Thanks,
    Stephen

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Slow tab completion w/ lots of tables
Next
From: Merlin Moncure
Date:
Subject: Re: sha1, sha2 functions into core?