You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't include "schema." in the set of possible tab completions once
"schema." has been typed. This allows readline to complete subsequent
characters immediately if all relations in the target schema start with
the same prefix. This actually worked before, but I unintentionally
broke it a few days ago.
Also, make completion schema-aware for GRANT, REVOKE, VACUUM.
" FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n "\
@@ -991,20 +991,11 @@ psql_completion(char *text, int start, int end)
991
991
elseif ((strcasecmp(prev3_wd, "GRANT") ==0||
992
992
strcasecmp(prev3_wd, "REVOKE") ==0) &&
993
993
strcasecmp(prev_wd, "ON") ==0)
994
-
COMPLETE_WITH_QUERY("SELECT pg_catalog.quote_ident(relname) FROM pg_catalog.pg_class c, pg_catalog.pg_namespace n "
995
-
" WHERE relkind in ('r','S','v') "
996
-
" AND substring(pg_catalog.quote_ident(relname),1,%d)='%s' "
997
-
" AND pg_catalog.pg_table_is_visible(c.oid) "
998
-
" AND relnamespace = n.oid "
999
-
" AND n.nspname NOT IN ('pg_catalog', 'pg_toast') "
1000
-
" UNION "
1001
-
"SELECT 'DATABASE' "
1002
-
" UNION "
1003
-
"SELECT 'FUNCTION' "
1004
-
" UNION "
1005
-
"SELECT 'LANGUAGE' "
1006
-
" UNION "
1007
-
"SELECT 'SCHEMA' ");
994
+
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tsv
995
+
" UNION SELECT 'DATABASE'"
996
+
" UNION SELECT 'FUNCTION'"
997
+
" UNION SELECT 'LANGUAGE'"
998
+
" UNION SELECT 'SCHEMA'");
1008
999
1009
1000
/* Complete "GRANT/REVOKE * ON * " with "TO" */
1010
1001
elseif ((strcasecmp(prev4_wd, "GRANT") ==0||
@@ -1251,7 +1242,10 @@ psql_completion(char *text, int start, int end)
1251
1242
1252
1243
/* VACUUM */
1253
1244
elseif (strcasecmp(prev_wd, "VACUUM") ==0)
1254
-
COMPLETE_WITH_QUERY("SELECT pg_catalog.quote_ident(relname) FROM pg_catalog.pg_class WHERE relkind='r' and substring(pg_catalog.quote_ident(relname),1,%d)='%s' and pg_catalog.pg_table_is_visible(oid) UNION SELECT 'FULL' UNION SELECT 'ANALYZE' UNION SELECT 'VERBOSE'");
0 commit comments