| From: | Andres Freund <andres(at)2ndquadrant(dot)com> | 
|---|---|
| To: | Jeff Janes <jeff(dot)janes(at)gmail(dot)com> | 
| Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | Re: tab completion for setting search_path | 
| Date: | 2014-05-03 08:11:33 | 
| Message-ID: | 20140503081133.GH12715@awork2.anarazel.de | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
On 2014-05-03 00:13:45 -0700, Jeff Janes wrote:
> On Friday, May 2, 2014, Jeff Janes <jeff(dot)janes(at)gmail(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andres Freund | 2014-05-03 08:15:44 | Re: quiet inline configure check misses a step for clang | 
| Previous Message | Andres Freund | 2014-05-03 08:09:56 | Re: Sending out a request for more buildfarm animals? |