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
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


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.


$ 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

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

Is this useful? Any suggestions, thoughts?


Kyotaro Horiguchi
NTT Open Source Software Center

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


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