tab-completion debug print

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: tab-completion debug print
Date: 2018-11-22 10:13:33
Message-ID: 20181122.191333.45427845.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello.

I was reminded that I was often annoyed with identifying the code
that made a word-completion, by hearing the same complaint from a
collegue of mine just now.

Something like the attached that tweaks completion_matches calls
lets psql emit the line number where a word-completion
happens. The output can be split out using redirection so that it
doesn't break into the conversation on console.

(make -s COPT=-DTABCOMPLETION_DEBUG install)

$ psql postgres 2>~debug.out
=# alt[tab]er [tab]t[tab]ab[tab] [tab]

You can see the following output in another bash session.

$ tail -f ~/debug.out
[1414][1435][1435][1435][1431]

Every number enclosed by brackets is the line number in
tab-complete.c, where completion happens.

Is this useful? Any suggestions, thoughts?

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
tab-completion-debug.patch text/x-patch 922 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2018-11-22 10:27:13 Re: Ordered Partitioned Table Scans
Previous Message Dmitry Dolgov 2018-11-22 10:11:47 Re: cursors with prepared statements