vartabcomplete.diff
text/x-patch
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: context
| File | + | − |
|---|---|---|
| src/bin/psql/tab-complete.c | 29 | 0 |
*** ./src/bin/psql/tab-complete.c.orig 2010-08-14 15:59:49.000000000 +0200
--- ./src/bin/psql/tab-complete.c 2010-08-16 11:44:49.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 mempry\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 ||