diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2011-12-20 00:05:19 +0200 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2011-12-20 00:05:19 +0200 |
commit | 729205571e81b4767efc42ad7beb53663e08d1ff (patch) | |
tree | 54081fe5cf5494bf77f0df20780b21288ba97411 /src/bin/psql/tab-complete.c | |
parent | 05e992e90e49aa5bca7e2b290ab736bfec97a7c1 (diff) |
Add support for privileges on types
This adds support for the more or less SQL-conforming USAGE privilege
on types and domains. The intent is to be able restrict which users
can create dependencies on types, which restricts the way in which
owners can alter types.
reviewed by Yeb Havinga
Diffstat (limited to 'src/bin/psql/tab-complete.c')
-rw-r--r-- | src/bin/psql/tab-complete.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index bb0fa09f3ea..473706246d0 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -2241,13 +2241,15 @@ psql_completion(char *text, int start, int end) pg_strcasecmp(prev_wd, "ON") == 0) COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tsvf, " UNION SELECT 'DATABASE'" + " UNION SELECT 'DOMAIN'" " UNION SELECT 'FOREIGN DATA WRAPPER'" " UNION SELECT 'FOREIGN SERVER'" " UNION SELECT 'FUNCTION'" " UNION SELECT 'LANGUAGE'" " UNION SELECT 'LARGE OBJECT'" " UNION SELECT 'SCHEMA'" - " UNION SELECT 'TABLESPACE'"); + " UNION SELECT 'TABLESPACE'" + " UNION SELECT 'TYPE'"); else if ((pg_strcasecmp(prev4_wd, "GRANT") == 0 || pg_strcasecmp(prev4_wd, "REVOKE") == 0) && pg_strcasecmp(prev2_wd, "ON") == 0 && @@ -2266,6 +2268,8 @@ psql_completion(char *text, int start, int end) { if (pg_strcasecmp(prev_wd, "DATABASE") == 0) COMPLETE_WITH_QUERY(Query_for_list_of_databases); + else if (pg_strcasecmp(prev_wd, "DOMAIN") == 0) + COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_domains, NULL); else if (pg_strcasecmp(prev_wd, "FUNCTION") == 0) COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_functions, NULL); else if (pg_strcasecmp(prev_wd, "LANGUAGE") == 0) @@ -2274,6 +2278,8 @@ psql_completion(char *text, int start, int end) COMPLETE_WITH_QUERY(Query_for_list_of_schemas); else if (pg_strcasecmp(prev_wd, "TABLESPACE") == 0) COMPLETE_WITH_QUERY(Query_for_list_of_tablespaces); + else if (pg_strcasecmp(prev_wd, "TYPE") == 0) + COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_datatypes, NULL); else if (pg_strcasecmp(prev4_wd, "GRANT") == 0) COMPLETE_WITH_CONST("TO"); else |