aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2015-08-18 12:49:04 -0400
committerRobert Haas <rhaas@postgresql.org>2015-08-18 12:50:28 -0400
commitf25087d26aa9c63ce90cd8e87131b6dbe943ba86 (patch)
treeaffb7d7e1b17a716edf92032285a887ff1d3821b
parent2c5c11ae9e0c5f4605fb9cdd2e8bd94fe0a06d95 (diff)
downloadpostgresql-f25087d26aa9c63ce90cd8e87131b6dbe943ba86.tar.gz
postgresql-f25087d26aa9c63ce90cd8e87131b6dbe943ba86.zip
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
-rw-r--r--src/bin/psql/tab-complete.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 4369d89e812..77af953003b 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -2593,6 +2593,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");