From: Sho Ito <i.sho.0628@gmail.com>
Subject: [PATCH v2] Fix tab completion for DROP INDEX CONCURRENTLY

The backend rejects CASCADE with DROP INDEX CONCURRENTLY, but psql
offers it as a completion. Remove the completion rule for trailing
CASCADE and RESTRICT: RESTRICT is the default and need not be suggested.

This also avoids completing IF to IF RESTRICT when entering
DROP INDEX CONCURRENTLY IF EXISTS. Ordinary DROP INDEX continues to
 offer both CASCADE and RESTRICT.

---
Changes in v2:
- Remove the rule instead of offering only RESTRICT, as suggested by Shihao.

 src/bin/psql/tab-complete.in.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/bin/psql/tab-complete.in.c b/src/bin/psql/tab-complete.in.c
--- a/src/bin/psql/tab-complete.in.c
+++ b/src/bin/psql/tab-complete.in.c
@@ -4348,8 +4348,6 @@
 	else if (Matches("DROP", "INDEX", "CONCURRENTLY"))
 		COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_indexes);
 	else if (Matches("DROP", "INDEX", MatchAny))
-		COMPLETE_WITH("CASCADE", "RESTRICT");
-	else if (Matches("DROP", "INDEX", "CONCURRENTLY", MatchAny))
 		COMPLETE_WITH("CASCADE", "RESTRICT");
 
 	/* DROP MATERIALIZED VIEW */
