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
559e7a0a
Commit
559e7a0a
authored
Mar 28, 2016
by
Teodor Sigaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
psql tab-complete for CREATE/DROP ACCESS METHOD
Alexander Korotkov
parent
dabd255d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
src/bin/psql/tab-complete.c
src/bin/psql/tab-complete.c
+13
-0
No files found.
src/bin/psql/tab-complete.c
View file @
559e7a0a
...
@@ -877,6 +877,7 @@ typedef struct
...
@@ -877,6 +877,7 @@ typedef struct
#define THING_NO_SHOW (THING_NO_CREATE | THING_NO_DROP)
#define THING_NO_SHOW (THING_NO_CREATE | THING_NO_DROP)
static
const
pgsql_thing_t
words_after_create
[]
=
{
static
const
pgsql_thing_t
words_after_create
[]
=
{
{
"ACCESS METHOD"
,
NULL
,
NULL
},
{
"AGGREGATE"
,
NULL
,
&
Query_for_list_of_aggregates
},
{
"AGGREGATE"
,
NULL
,
&
Query_for_list_of_aggregates
},
{
"CAST"
,
NULL
,
NULL
},
/* Casts have complex structures for names, so
{
"CAST"
,
NULL
,
NULL
},
/* Casts have complex structures for names, so
* skip it */
* skip it */
...
@@ -1977,6 +1978,17 @@ psql_completion(const char *text, int start, int end)
...
@@ -1977,6 +1978,17 @@ psql_completion(const char *text, int start, int end)
COMPLETE_WITH_LIST5
(
"HEADER"
,
"QUOTE"
,
"ESCAPE"
,
"FORCE QUOTE"
,
COMPLETE_WITH_LIST5
(
"HEADER"
,
"QUOTE"
,
"ESCAPE"
,
"FORCE QUOTE"
,
"FORCE NOT NULL"
);
"FORCE NOT NULL"
);
/* CREATE ACCESS METHOD */
/* Complete "CREATE ACCESS METHOD <name>" */
else
if
(
Matches4
(
"CREATE"
,
"ACCESS"
,
"METHOD"
,
MatchAny
))
COMPLETE_WITH_CONST
(
"TYPE"
);
/* Complete "CREATE ACCESS METHOD <name> TYPE" */
else
if
(
Matches5
(
"CREATE"
,
"ACCESS"
,
"METHOD"
,
MatchAny
,
"TYPE"
))
COMPLETE_WITH_CONST
(
"INDEX"
);
/* Complete "CREATE ACCESS METHOD <name> TYPE <type>" */
else
if
(
Matches6
(
"CREATE"
,
"ACCESS"
,
"METHOD"
,
MatchAny
,
"TYPE"
,
MatchAny
))
COMPLETE_WITH_CONST
(
"HANDLER"
);
/* CREATE DATABASE */
/* CREATE DATABASE */
else
if
(
Matches3
(
"CREATE"
,
"DATABASE"
,
MatchAny
))
else
if
(
Matches3
(
"CREATE"
,
"DATABASE"
,
MatchAny
))
COMPLETE_WITH_LIST9
(
"OWNER"
,
"TEMPLATE"
,
"ENCODING"
,
"TABLESPACE"
,
COMPLETE_WITH_LIST9
(
"OWNER"
,
"TEMPLATE"
,
"ENCODING"
,
"TABLESPACE"
,
...
@@ -2263,6 +2275,7 @@ psql_completion(const char *text, int start, int end)
...
@@ -2263,6 +2275,7 @@ psql_completion(const char *text, int start, int end)
else
if
(
Matches3
(
"DROP"
,
else
if
(
Matches3
(
"DROP"
,
"COLLATION|CONVERSION|DOMAIN|EXTENSION|LANGUAGE|SCHEMA|SEQUENCE|SERVER|TABLE|TYPE|VIEW"
,
"COLLATION|CONVERSION|DOMAIN|EXTENSION|LANGUAGE|SCHEMA|SEQUENCE|SERVER|TABLE|TYPE|VIEW"
,
MatchAny
)
||
MatchAny
)
||
Matches4
(
"DROP"
,
"ACCESS"
,
"METHOD"
,
MatchAny
)
||
(
Matches4
(
"DROP"
,
"AGGREGATE|FUNCTION"
,
MatchAny
,
MatchAny
)
&&
(
Matches4
(
"DROP"
,
"AGGREGATE|FUNCTION"
,
MatchAny
,
MatchAny
)
&&
ends_with
(
prev_wd
,
')'
))
||
ends_with
(
prev_wd
,
')'
))
||
Matches4
(
"DROP"
,
"EVENT"
,
"TRIGGER"
,
MatchAny
)
||
Matches4
(
"DROP"
,
"EVENT"
,
"TRIGGER"
,
MatchAny
)
||
...
...
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