On Wed, Jul 16, 2014 at 4:34 AM, Pavel Stehule <pavel.steh...@gmail.com> wrote: > > > > 2014-07-15 12:07 GMT+02:00 Fujii Masao <masao.fu...@gmail.com>: > >> On Tue, Jul 15, 2014 at 7:01 PM, Pavel Stehule <pavel.steh...@gmail.com> >> wrote: >> > >> > >> > >> > 2014-07-15 11:29 GMT+02:00 Fujii Masao <masao.fu...@gmail.com>: >> > >> >> On Thu, Jul 10, 2014 at 9:56 PM, Pavel Stehule >> >> <pavel.steh...@gmail.com> >> >> wrote: >> >> > Hello >> >> > >> >> > here is a proposed patch - autocomplete for known psql variable >> >> > content >> >> >> >> Even after applying the patch, the following psql variables were not >> >> displayed >> >> on the tab-completion of \set command. >> >> >> >> HISTFILE >> >> HISTSIZE >> >> HOST >> >> IGNOREEOF >> >> LASTOID >> >> >> >> I'm not sure if it's worth displaying all of them on the tab-completion >> >> of >> >> \set >> >> because it seems strange to change some of them by \set command, for >> >> example >> >> HOST, though. >> > >> > >> > For these variables are not default - so doesn't exist and cannot be >> > completed by default. >> > >> > there are two fix: >> > >> > a) fix autocomplete source - preferred >> >> +1 > > > here is the patch
Thanks for the patch! I got the following compiler warnings. tab-complete.c:4155: warning: assignment discards qualifiers from pointer target type tab-complete.c:4166: warning: assignment discards qualifiers from pointer target type + "FETCH_COUNT", "HISTCONTROL", "HISTFILE", "HISTSIZE", "HOST", "IGNOREOFF", Typo: IGNOREOFF -> IGNOREEOF + /* all psql known variables are included in list by default */ + for (known_varname = known_varnames; *known_varname; known_varname++) + varnames[nvars++] = pg_strdup(*known_varname); Don't we need to append both prefix and suffix to even known variables? + else if (strcmp(prev2_wd, "\\set") == 0) + { + if (strcmp(prev_wd, "AUTOCOMMIT") == 0) ISTM that some psql variables like IGNOREEOF are not there. Why not? Regards, -- Fujii Masao -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers