Some bugs in psql_complete of psql

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Some bugs in psql_complete of psql
Date: 2015-11-04 08:27:32
Message-ID: 20151104.172732.172032055.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 sth
CONCURRENTLY")

- 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 items
above, though. This applied back to 9.3 and 9.2 doesn't have
"EVENT TRIGGER" and "MATERIALIZED VIEW" and 9.1 additionally
doesn't have "DATABASE" and "ROLE". I'll provide individual
patches if necessary.

regards,

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
0001-Fix-some-tab-completino-bugs.patch text/x-patch 5.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kouhei Kaigai 2015-11-04 08:28:11 Re: Foreign join pushdown vs EvalPlanQual
Previous Message Kouhei Kaigai 2015-11-04 08:10:57 Re: Foreign join pushdown vs EvalPlanQual