fixed spelling Regards
Pavel Stehule 2010/8/16 Pavel Stehule <pavel.steh...@gmail.com>: > Hello > > I found so there are not support for tabcomple of psql variables. > > Regards > > Pavel Stehule >
*** ./src/bin/psql/tab-complete.c.orig 2010-08-14 15:59:49.000000000 +0200 --- ./src/bin/psql/tab-complete.c 2010-08-16 13:30:54.000000000 +0200 *************** *** 2517,2522 **** --- 2517,2551 ---- COMPLETE_WITH_LIST(my_list); } + else if (strcmp(prev_wd, "\\set") == 0) + { + const char **varnames; + int nvars = 0; + int size = 100; + struct _variable *ptr; + + varnames = (const char **) pg_malloc(size * sizeof(char *)); + + /* fill array of varnames */ + for (ptr = pset.vars->next; ptr; ptr = ptr->next) + { + if (nvars == size) + { + size = size + 100; + varnames = realloc(varnames, size * sizeof(char *)); + if (!varnames) + { + psql_error("out of memory\n"); + exit(EXIT_FAILURE); + } + } + varnames[nvars++] = ptr->name; + } + varnames[nvars] = NULL; + COMPLETE_WITH_LIST(varnames); + + free(varnames); + } else if (strcmp(prev_wd, "\\sf") == 0 || strcmp(prev_wd, "\\sf+") == 0) COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_functions, NULL); else if (strcmp(prev_wd, "\\cd") == 0 ||
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers