Re: Making tab-complete.c easier to maintain

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: alvherre(at)2ndquadrant(dot)com, michael(dot)paquier(at)gmail(dot)com, thomas(dot)munro(at)enterprisedb(dot)com
Cc: jeff(dot)janes(at)gmail(dot)com, tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Making tab-complete.c easier to maintain
Date: 2015-11-26 05:45:12
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello, the attached are a patchset to introduce a special
matching expression which simplifies matching descriptions. The
result looks as if the comments in the previous implement run


A small patch to allow pg_regex to be used outside backend. The
same with the previous one.


This is also the same with the previous one.


Modifies to use this matching minilang. No bare regular
expression is seen for every matching. The difference from the
previous one is that sources for other than regcomp.o are no
longer symlinked to psql's directory. Compiled regular
expressions are cached until psql ends. The function patcomp is
the central of the messy of this patchset.

This cannot be compiled on Windows, I think.


Remove comments that no longer has reason to be placed there.


Merge some of the matchings that are simply mergable by using
this minilang.

What do you think about this solution?

At Tue, 17 Nov 2015 19:25:24 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote in <20151117(dot)192524(dot)95155716(dot)horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
> Hello, I tried to implement the mini-language, which is a
> simplified reglar expression for this specific use.
> As a ultra-POC, the attached patch has very ad-hoc preprocess
> function and does on-the-fly preprocessing, compilation then
> execution of regular expression. And it is applied to only the
> first ten or so matchings in psql_completion().
> The first attachment is the same with that of previous patchset.
> Every matching line looks like the following,
> > else if (RM("ALTER {AGGREGATE|FUNCTION} [#id](.."))

Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
0001-Allow-regex-module-to-be-used-outside-server.patch text/x-patch 4.3 KB
0002-Simplify-the-usages-of-COMPLETE_WITH_QUERY.patch text/x-patch 29.7 KB
0003-Replace-existing-completions-with-regular-expression.patch text/x-patch 152.5 KB
0004-Remove-less-informative-comments.patch text/x-patch 47.2 KB
0005-Merge-mergable-completions.patch text/x-patch 14.7 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-11-26 05:55:17 Re: COPY (INSERT/UPDATE/DELETE .. RETURNING ..)
Previous Message Kyotaro HORIGUCHI 2015-11-26 05:19:24 Re: [Proposal] Table partition + join pushdown