]> granicus.if.org Git - postgresql/commitdiff
psql: Make EXECUTE PROCEDURE tab completion a bit narrower.
authorRobert Haas <rhaas@postgresql.org>
Tue, 18 Aug 2015 16:49:04 +0000 (12:49 -0400)
committerRobert Haas <rhaas@postgresql.org>
Tue, 18 Aug 2015 16:50:09 +0000 (12:50 -0400)
If the user has typed GRANT EXECUTE, the correct completion is "ON",
not "PROCEDURE".

Daniel Verite

src/bin/psql/tab-complete.c

index 62cb721cc2559d420a00aeef53e8ca00476d7ab0..816deda1cf81f993bd3cc3a9600d78f073f45c3d 100644 (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");