Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
4189e3d6
Commit
4189e3d6
authored
Jan 16, 2016
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
psql: Add completion support for DROP INDEX CONCURRENTLY
based on patch by Kyotaro Horiguchi
parent
cf7dfbf2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
src/bin/psql/tab-complete.c
src/bin/psql/tab-complete.c
+14
-3
No files found.
src/bin/psql/tab-complete.c
View file @
4189e3d6
...
...
@@ -2009,8 +2009,8 @@ psql_completion(const char *text, int start, int end)
else
if
(
TailMatches3
(
"INDEX|CONCURRENTLY"
,
MatchAny
,
"ON"
)
||
TailMatches2
(
"INDEX|CONCURRENTLY"
,
"ON"
))
COMPLETE_WITH_SCHEMA_QUERY
(
Query_for_list_of_tm
,
NULL
);
/* Complete
...
INDEX CONCURRENTLY with "ON" and existing indexes */
else
if
(
TailMatches
2
(
"INDEX"
,
"CONCURRENTLY"
))
/* Complete
CREATE|UNIQUE
INDEX CONCURRENTLY with "ON" and existing indexes */
else
if
(
TailMatches
3
(
"CREATE|UNIQUE"
,
"INDEX"
,
"CONCURRENTLY"
))
COMPLETE_WITH_SCHEMA_QUERY
(
Query_for_list_of_indexes
,
" UNION SELECT 'ON'"
);
/* Complete CREATE|UNIQUE INDEX [CONCURRENTLY] <sth> with "ON" */
...
...
@@ -2247,7 +2247,7 @@ psql_completion(const char *text, int start, int end)
/* DROP */
/* Complete DROP object with CASCADE / RESTRICT */
else
if
(
Matches3
(
"DROP"
,
"COLLATION|CONVERSION|DOMAIN|EXTENSION|
INDEX|
LANGUAGE|SCHEMA|SEQUENCE|SERVER|TABLE|TYPE|VIEW"
,
"COLLATION|CONVERSION|DOMAIN|EXTENSION|LANGUAGE|SCHEMA|SEQUENCE|SERVER|TABLE|TYPE|VIEW"
,
MatchAny
)
||
(
Matches4
(
"DROP"
,
"AGGREGATE|FUNCTION"
,
MatchAny
,
MatchAny
)
&&
ends_with
(
prev_wd
,
')'
))
||
...
...
@@ -2265,6 +2265,17 @@ psql_completion(const char *text, int start, int end)
else
if
(
Matches2
(
"DROP"
,
"FOREIGN"
))
COMPLETE_WITH_LIST2
(
"DATA WRAPPER"
,
"TABLE"
);
/* DROP INDEX */
else
if
(
Matches2
(
"DROP"
,
"INDEX"
))
COMPLETE_WITH_SCHEMA_QUERY
(
Query_for_list_of_indexes
,
" UNION SELECT 'CONCURRENTLY'"
);
else
if
(
Matches3
(
"DROP"
,
"INDEX"
,
"CONCURRENTLY"
))
COMPLETE_WITH_SCHEMA_QUERY
(
Query_for_list_of_indexes
,
NULL
);
else
if
(
Matches3
(
"DROP"
,
"INDEX"
,
MatchAny
))
COMPLETE_WITH_LIST2
(
"CASCADE"
,
"RESTRICT"
);
else
if
(
Matches4
(
"DROP"
,
"INDEX"
,
"CONCURRENTLY"
,
MatchAny
))
COMPLETE_WITH_LIST2
(
"CASCADE"
,
"RESTRICT"
);
/* DROP MATERIALIZED VIEW */
else
if
(
Matches2
(
"DROP"
,
"MATERIALIZED"
))
COMPLETE_WITH_CONST
(
"VIEW"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment