Re: psql completion for ids in multibyte string

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: psql completion for ids in multibyte string
Date: 2016-02-26 05:34:03
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello, this is the second patch plitted out. This allows
multibyte names to be completed in psql.

At Fri, 06 Nov 2015 11:47:17 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote in <20151106(dot)114717(dot)170526268(dot)horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
> At Thu, 5 Nov 2015 18:32:59 +0900, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> wrote in <563B224B(dot)3020400(at)lab(dot)ntt(dot)co(dot)jp>
> > On 2015/11/05 18:10, Kyotaro HORIGUCHI wrote:
> > > Hello. I don't know whether this is a bug fix or improvement,
> >
> > Would it be 50-50? :-)
> Yeah, honestly saying, I doubt that this is valuable but feel
> uneasy to see some of the candidates vanish as completon proceeds
> for no persuasive reason.

The current version of tab-completion failed to complete names
with multibyte characters.

=# create table いろは (あ int);
=# create table いこい (あ int);
=# drop table <tab>
"いろは" hint_plan. pg_toast.
"いこい" information_schema. pg_toast_temp_1.
ALL IN TABLESPACE pg_catalog. public.
dbms_stats. pg_temp_1.
postgres=# alter table "い
=# drop table "い<tab>
=# drop table "い /* No candidate offered */

This is because _complet_from_query counts the string length in
bytes, instead of characters. With this patch the candidates will

=# drop table "い<tab>
"いこい" "いろは"
postgres=# drpo table "い


Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
0001-Fix-identifier-completion-with-multibyte-characters.patch text/x-patch 1.4 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2016-02-26 05:43:23 Re: [REVIEW] In-core regression tests for replication, cascading, archiving, PITR, etc.
Previous Message Kyotaro HORIGUCHI 2016-02-26 05:33:41 Fixing wrong comment on PQmblen and PQdsplen.