Re: Making tab-complete.c easier to maintain

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: michael(dot)paquier(at)gmail(dot)com
Cc: alvherre(at)2ndquadrant(dot)com, thomas(dot)munro(at)enterprisedb(dot)com, 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-12-09 08:33:06
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hello, please find the attached revised patches.

At Tue, 08 Dec 2015 18:31:10 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote in <20151208(dot)183110(dot)229901672(dot)horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
> > This patch fails to compile on OSX:
> > Undefined symbols for architecture x86_64:
> > "_ExceptionalCondition", referenced from:
> > _pg_regexec in regexec.o
> > ...

I have fixed it.

> > So, to begin with, this may be better if replugged as a standalone
> > library, aka moving the regexp code into src/common for example or
> > similar.
> I agree to that. I'll consider doing so. (But my middle finger
> tip injury makes me further slower than usual..)

Done. They are moved into common/regex.

.../backend/utils/mb/wstrncase.o still remains in psql/Makefile
but moving it would makes it more odd so it is left as it is.

> > Also, per the comments on top of rcancelrequested,
> > rstacktoodeep and rcancelrequested, returning unconditionally 0 is not
> > a good idea for -DFRONTEND. Callbacks should be defined and made
> > available for callers.

Done. pg_regcomp now has additinal parameter, which can be NULL
on backend.

> cancel_pressed is usable for the purpose and I'll add
> cancel_callback feeature to separate it from both frontend and
> backend.
> > + {"MATERIALIZED VIEW", NULL, &Query_for_list_of_matviews},
> > This has value as a separate patch.
> I carelessly merged it in the fourth (Merge mergable...)
> patch. I'll separate it.

This is not added in this patchset. I'll post it later.

> > The patch has many whitespaces, and unrelated diffs.
> Mmm, thanks for pointing it out. I haven't see such lines differ
> only in whitespaces or found unrelated diffs so far but I'll
> check it out.

I think they are whitespaces in existing file and they Some lines in
header comments have trailing space and I can remove them not
only for files I moved but for all files. But it should be as
another patch. Is it worth doing?

I found a bug in matching for "DELETE" so fixed it.


Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
0001-Allow-regex-module-to-be-used-outside-server.patch text/x-patch 751.6 KB
0002-Add-a-parameter-to-COMPLETE_WITH_QUERY.patch text/x-patch 29.7 KB
0003-Replace-existing-completions-with-regular-expression.patch text/x-patch 153.3 KB
0004-Remove-less-informative-comments.patch text/x-patch 47.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2015-12-09 08:47:37 Re: Move PinBuffer and UnpinBuffer to atomics
Previous Message Etsuro Fujita 2015-12-09 08:22:38 Re: Foreign join pushdown vs EvalPlanQual