]> granicus.if.org Git - postgresql/commit
Fix tab completion of "SET variable TO|=" to not offer bogus completions.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 2 Jul 2019 17:35:14 +0000 (13:35 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 2 Jul 2019 17:35:14 +0000 (13:35 -0400)
commit90434e6f2cf9fb629069b1b3017ea1a2c1ab07eb
tree25175efac21dde1c980de931955e412169201034
parentcd9d48969d944c3558a77745db389e8b68b46c4b
Fix tab completion of "SET variable TO|=" to not offer bogus completions.

Don't think that the context "UPDATE tab SET var =" is a GUC-setting
command.

If we have "SET var =" but the "var" is not a known GUC variable,
don't offer any completions.  The most likely explanation is that
we've misparsed the context and it's not really a GUC-setting command.

Per gripe from Ken Tanzer.  Back-patch to 9.6.  The issue exists
further back, but before 9.6 the code looks very different and it
doesn't actually know whether the "var" name matches anything,
so I desisted from trying to fix it.

Discussion: https://postgr.es/m/CAD3a31XpXzrZA9TT3BqLSHghdTK+=cXjNCE+oL2Zn4+oWoc=qA@mail.gmail.com
src/bin/psql/tab-complete.c