Re: tab-completion debug print

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: david(at)fetter(dot)org
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)postgresql(dot)org
Subject: Re: tab-completion debug print
Date: 2018-12-13 11:07:39
Message-ID: 20181213.200739.07969126.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

Hello.

At Wed, 28 Nov 2018 17:28:39 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote in <20181128(dot)172839(dot)242071562(dot)horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
> I'm not sure how much it is wanted but it's easy to do. Using
> psql variable doesn't seem to make sense since the debug print
> (currently) requires session log file, which can be turned on
> only at the startup time. '-g' option is available by 0003.
>
> $ psql -gL ~/psql.log postgres
>
> > Can we conceive of a circumstance where the check for -L/\L would be
> > significant? I've seen people type pretty quickly, but not thus far
> > fast enough to notice a cache miss.
>
> We could switch completion_matches body as necessity using
> function poniter, but we aren't so eager for speed here. It is at
> most called every time entering tab.

So, the new version v6 patch consists of the following two files:

- v6-0001-Tab-copletion-debug-log.patch

Full-context version. Activated by -DTABCOMPLETION_DEBUG at
compile time and always emit logs into session log file
specified -L. The format of a line looks like below.

> tab-complete.c:1870: (...table t1 alter [CO]) -> ("CO", "COLUMN", "CONSTRAINT")

- v6-0002-Add-psql-g-option-to-control-debug-print.patch

Applies on top of 0001. Code is always active, -g addition to
-L activates debug print into the log file. If only -g is
specified it is forcibly turned off.

> $ psql postgres -g
> psql: no session log file, turn off debug print
> psql (12devel)
> Type "help" for help.

-g option shows in help message. (perhaps arguable.)

I'll register this to the next CF.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
v6-0001-Tab-copletion-debug-log.patch text/x-patch 4.6 KB
v6-0002-Add-psql-g-option-to-control-debug-print.patch text/x-patch 4.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2018-12-13 12:03:54 Re: Connections hang indefinitely while taking a gin index's LWLock buffer_content lock
Previous Message Sergei Kornilov 2018-12-13 10:51:48 Re: allow online change primary_conninfo