|From:||Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>|
|Subject:||Re: Some bugs in psql_complete of psql|
|Views:||Raw Message | Whole Thread | Download mbox | Resend email|
Hello, I returned to this since Thomas' psql-completion patch has
This patch has been recreated on it.
"IN TABLESPACE xxx OWNED BY" has been alredy fixed so I removed it.
The attched files are the following,
Fixes completion for CREATE INDEX in ordinary way.
An alternative for 1. Introduces multilevel matching. This
effectively can avoid false matching, simplify each expression
and reduce the number of matching operations.
Fix of DROP INDEX completion in the type-2 way.
At Tue, 08 Dec 2015 17:56:19 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote in <20151208(dot)175619(dot)245979824(dot)horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
> > I tested whether the following patterns work as expected or not.
> > CREATE UNIQUE INDEX CONCURRENTLY name ON
> > CREATE UNIQUE INDEX CONCURRENTLY ON
> > CREATE UNIQUE INDEX name ON
> > CREATE UNIQUE INDEX ON
> > CREATE INDEX CONCURRENTLY name ON
> > CREATE INDEX CONCURRENTLY ON
> > CREATE INDEX name ON
> > CREATE INDEX ON
> > Then I found the following problems.
> > "CREATE UNIQUE INDEX CONCURRENTLY <tab>" didn't suggest "ON".
> > "CREATE UNIQUE INDEX ON <tab>" suggested nothing.
> > "CREATE INDEX ON <tab>" suggested nothing.
All of the cases above are completed correctly. As a new feature,
this patch allows "IF NOT EXISTS". As the result, the following
part of the syntax of CREATE INDEX is completed correctly.
CREATE [UNIQUE] INDEX [CONCURRENTLY] [[IF NOT EXISTS] iname] ON tname
> > "CREATE INDEX CONCURRENTLY <tab>" didn't suggest "ON".
Now it suggests "ON", "IF NOT EXISTS" and existing index names.
> > BTW, I found that tab-completion for DROP INDEX has the following problems.
> > "DROP INDEX <tab>" didn't suggest "CONCURRENTLY".
> > "DROP INDEX CONCURRENTLY name <tab>" suggested nothing.
They are completed by the "things" completion. The first patch
gives a wrong suggestion for DROP INDEX CONCURRENTLY with "IF NOT
EXISTS". This can be avoided adding HeadMatches to every matching
for "CREATE INDEX..." syntexes but it is too bothersome.
Instaed, in the second alternative patch, I enclosed the whole
"CREATE INDEX" stuff by an if(HeadMatches2("CREATE",
"UNIQUE|INDEX")) block to avoid the false match and simplify each
matching expression. As a side effect, the total number of the
executions of matching expressions can be reduced. (This wouldn't
be just a bug fix, but rarther a kind of refactoring.)
The third patch fixes the behavior for DROP INDEX in this way.
NTT Open Source Software Center
|Next Message||Pavel Stehule||2015-12-22 09:45:30||Re: custom function for converting human readable sizes to bytes|
|Previous Message||Peter Geoghegan||2015-12-22 09:36:52||Re: A Typo in regress/sql/privileges.sql|