On 2014-05-03 00:13:45 -0700, Jeff Janes wrote: > On Friday, May 2, 2014, Jeff Janes <jeff.ja...@gmail.com> wrote: > > > I've been working with an app that uses a schema name whose spelling is > > hard to type, and the lack of tab completion for "SET search_path TO" was > > bugging me. So see attached. > > > > I filter out the system schemata, but not public.
That'd be nice. > diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c > new file mode 100644 > index 6d26ffc..dec3d4a > *** a/src/bin/psql/tab-complete.c > --- b/src/bin/psql/tab-complete.c > *************** psql_completion(const char *text, int st > *** 3230,3235 **** > --- 3230,3242 ---- > > COMPLETE_WITH_LIST(my_list); > } > + else if (pg_strcasecmp(prev2_wd, "search_path") == 0) > + { > + COMPLETE_WITH_QUERY(Query_for_list_of_schemas > + " AND nspname > not like 'pg\\_%%' " > + " AND nspname > not like 'information_schema' " > + " UNION SELECT > 'DEFAULT' "); > + } Why should we exclude system schemata? That seems more likely to be confusing than helpful? I can see a point in excluding another backend's temp tables, but otherwise? Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers