psql: Make EXECUTE PROCEDURE tab completion a bit narrower.

If the user has typed GRANT EXECUTE, the correct completion is "ON",
not "PROCEDURE".

Daniel Verite
This commit is contained in:
Robert Haas 2015-08-18 12:49:04 -04:00
parent d3eaab3ef0
commit db5a703bf6
1 changed files with 1 additions and 0 deletions

View File

@ -2622,6 +2622,7 @@ psql_completion(const char *text, int start, int end)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_views, NULL);
/* complete CREATE TRIGGER ... EXECUTE with PROCEDURE */
else if (pg_strcasecmp(prev_wd, "EXECUTE") == 0 &&
!(pg_strcasecmp(prev2_wd, "GRANT") == 0 && prev3_wd[0] == '\0') &&
prev2_wd[0] != '\0')
COMPLETE_WITH_CONST("PROCEDURE");