|From:||Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>|
|Subject:||Re: IF (NOT) EXISTS in psql-completion|
|Views:||Raw Message | Whole Thread | Download mbox | Resend email|
Hello, thank you for the comments.
At Mon, 15 Feb 2016 15:43:57 +0300, Artur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru> wrote in <56C1C80D(dot)7020101(at)postgrespro(dot)ru>
> On 05.02.2016 11:09, Kyotaro HORIGUCHI wrote:
> > Hello,
> > I considered how to make tab-completion robust for syntactical
> > noises, in other words, optional words in syntax. Typically "IF
> > (NOT) EXISTS", UNIQUE and TEMPORARY are words that don't affect
> > further completion. However, the current delimit-matching
> > mechanism is not so capable (or is complexty-prone) to live with
> > such noises. I have proposed to use regular expressions or
> > simplified one for the robustness but it was too complex to be
> > applied.
> > This is another answer for the problem. Removal of such words
> > on-the-fly makes further matching more robust.
> > Next, currently some CREATE xxx subsyntaxes of CREATE SCHEMA are
> > matched using TailMatching but it makes difficult the
> > options-removal operations, which needs forward matching.
> > So I introduced two things to resolve them by this patch.
> I did some tests with your patch. But I am not confident in
> And I have some notes:
> 1 - I execute git apply command and get the following warning:
> trailing whitespace.
> warning: 1 line adds whitespace errors.
> This is because of superfluous whitespace I think.
Oops. I'll remove it.
> 2 - In psql I write "create table if" and press <TAB>. psql adds the
> create table IF NOT EXISTS
> I think psql should continue with lower case if user wrote query with
> loser case text:
Good catch! Hmm. COMPLETE_WITH_SCHEMA_QUERY() does it. For
example, the following existing completion behaves in the same
"drop index c" =<tab>=> "drop index CONCURRENTLY"
The results of schema queries should be treated in case-sensitive
way so the additional keywords by 'UNION' are also treated
" UNION SELECT 'CONCURRENTLY'");
Fixing this is another problem. So I'd like to leave this alone
> create table if not exists
> 3 - Same with "IF EXISTS". If a write "alter view if" and press <TAB>
> psql writes:
> alter view IF EXISTS
Phone: 03-5860-5115 / Fax: 03-5463-5490
|Next Message||Craig Ringer||2016-02-26 04:47:52||Re: [REVIEW] In-core regression tests for replication, cascading, archiving, PITR, etc.|
|Previous Message||Tomas Vondra||2016-02-26 04:03:34||Re: improving GROUP BY estimation|