--On 3. Mai 2014 10:11:33 +0200 Andres Freund <and...@2ndquadrant.com> wrote:

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?

I put my hands on this a while ago, too, but had a different notion in mind, which schema the completion should select. I came up with the following:

<http://git.postgresql.org/gitweb/?p=users/bernd/postgres.git;a=commitdiff;h=03fd00cd190e8b529efeec1a1bb038454fb0b05f>

Just complete to a schema someone has CREATE or USAGE privs. However, the reason i stopped working on it was that i really want to have a completion to a list of schemas as well and i couldn't figure a good and easy way to do this atm.

--
Thanks

        Bernd


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to