[PATCH] Add tab completion support for JOIN
Started by Andrey Poppalmost 15 years ago2 messages
Hello,
I've produced a dumb patch for psql which allow to use tab completion after JOIN keyword.
Patch was done against 2f6c8453cf3f38a70adbcb59489630cd5be92570 revision from GitHub mirror.
Attachments:
join_completion.patchapplication/octet-stream; name=join_completion.patchDownload
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index de34f25..2214471 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -2751,6 +2751,10 @@ psql_completion(char *text, int start, int end)
pg_strcasecmp(prev3_wd, "\\copy") != 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tsvf, NULL);
+/* ... JOIN ... */
+ else if (pg_strcasecmp(prev_wd, "JOIN") == 0)
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tsvf, NULL);
+
/* Backslash commands */
/* TODO: \dc \dd \dl */
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
Re: [PATCH] Add tab completion support for JOIN
On 02.03.2011 20:28, Andrey Popp wrote:
I've produced a dumb patch for psql which allow to use tab completion after JOIN keyword.
Patch was done against 2f6c8453cf3f38a70adbcb59489630cd5be92570 revision from GitHub mirror.
Thanks, applied.
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com