Some bugs in psql_complete of psql - Mailing list pgsql-hackers

From Kyotaro HORIGUCHI
Subject Some bugs in psql_complete of psql
Date
Msg-id 20151104.172732.172032055.horiguchi.kyotaro@lab.ntt.co.jp
Whole thread Raw
Responses Re: Some bugs in psql_complete of psql  (Fujii Masao <masao.fujii@gmail.com>)
List pgsql-hackers
Hello, I found that a typo(?) in tab-complete.c.

> /* ALTER TABLE,INDEX,MATERIALIZED VIEW xxx ALL IN TABLESPACE xxx OWNED BY */
> else if (pg_strcasecmp(prev6_wd, "ALL") == 0 &&
>          pg_strcasecmp(prev5_wd, "IN") == 0 &&
>          pg_strcasecmp(prev4_wd, "TABLESPACE") == 0 &&
>          pg_strcasecmp(prev2_wd, "OWNED") == 0 &&
>          pg_strcasecmp(prev4_wd, "BY") == 0)

"BY" is compared against the word in wrong position and it
prevents this completion from matching.

I also found some other bugs in psql-completion. The attached
patch applied on master and fixes them all togher.

- Fix completion for ALL IN TABLESPACE OWNED BY.

- Fix the assumed syntax of CREATE INDEX where the CONCURRENTLY is misplaced. (It is assuming the order "CREATE INDEX
sthCONCURRENTLY")
 

- Provide missing terminating NULL to the preposition list for SECURITY LABEL.

- Add the preposition list with some missing items. However, this would not be a kind of bug in constrast to the three
itemsabove, though. This applied back to 9.3 and 9.2 doesn't have "EVENT TRIGGER" and "MATERIALIZED VIEW" and 9.1
additionallydoesn't have "DATABASE" and "ROLE". I'll provide individual patches if necessary.
 

regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center

pgsql-hackers by date:

Previous
From: Etsuro Fujita
Date:
Subject: Re: Foreign join pushdown vs EvalPlanQual
Next
From: Kouhei Kaigai
Date:
Subject: Re: Foreign join pushdown vs EvalPlanQual