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
d0066b9f
Commit
d0066b9f
authored
Nov 02, 2004
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tab completion for CREATE TABLESPACE arguments. Patch by Joachim Wieland.
parent
745bb960
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
5 deletions
+24
-5
src/bin/psql/tab-complete.c
src/bin/psql/tab-complete.c
+24
-5
No files found.
src/bin/psql/tab-complete.c
View file @
d0066b9f
...
...
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2004, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.11
6 2004/09/22 04:25:16 neilc
Exp $
* $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.11
7 2004/11/02 16:10:05 petere
Exp $
*/
/*----------------------------------------------------------------------
...
...
@@ -488,7 +488,8 @@ psql_completion(char *text, int start, int end)
char
*
prev_wd
,
*
prev2_wd
,
*
prev3_wd
,
*
prev4_wd
;
*
prev4_wd
,
*
prev5_wd
;
static
const
char
*
const
sql_commands
[]
=
{
"ABORT"
,
"ALTER"
,
"ANALYZE"
,
"BEGIN"
,
"CHECKPOINT"
,
"CLOSE"
,
"CLUSTER"
,
"COMMENT"
,
...
...
@@ -637,6 +638,7 @@ psql_completion(char *text, int start, int end)
prev2_wd
=
previous_word
(
start
,
1
);
prev3_wd
=
previous_word
(
start
,
2
);
prev4_wd
=
previous_word
(
start
,
3
);
prev5_wd
=
previous_word
(
start
,
4
);
/* If a backslash command was started, continue */
if
(
text
[
0
]
==
'\\'
)
...
...
@@ -766,14 +768,14 @@ psql_completion(char *text, int start, int end)
{
static
const
char
*
const
list_ALTERSCHEMA2
[]
=
{
"MINVALUE"
,
"MAXVALUE"
,
"CYCLE"
,
NULL
};
COMPLETE_WITH_LIST
(
list_ALTERSCHEMA2
);
}
/* ALTER TRIGGER <name>, add ON */
else
if
(
pg_strcasecmp
(
prev3_wd
,
"ALTER"
)
==
0
&&
pg_strcasecmp
(
prev2_wd
,
"TRIGGER"
)
==
0
)
COMPLETE_WITH_CONST
(
"ON"
);
else
if
(
pg_strcasecmp
(
prev4_wd
,
"ALTER"
)
==
0
&&
pg_strcasecmp
(
prev3_wd
,
"TRIGGER"
)
==
0
)
{
...
...
@@ -1004,7 +1006,7 @@ psql_completion(char *text, int start, int end)
{
static
const
char
*
const
list_FROMTO
[]
=
{
"FROM"
,
"TO"
,
NULL
};
COMPLETE_WITH_LIST
(
list_FROMTO
);
}
/* If we have COPY|BINARY <sth> FROM|TO, complete with filename */
...
...
@@ -1112,6 +1114,23 @@ psql_completion(char *text, int start, int end)
pg_strcasecmp
(
prev_wd
,
"TEMP"
)
==
0
)
COMPLETE_WITH_CONST
(
"TABLE"
);
/* CREATE TABLESPACE */
else
if
(
pg_strcasecmp
(
prev3_wd
,
"CREATE"
)
==
0
&&
pg_strcasecmp
(
prev2_wd
,
"TABLESPACE"
)
==
0
)
{
static
const
char
*
const
list_CREATETABLESPACE
[]
=
{
"OWNER"
,
"LOCATION"
,
NULL
};
COMPLETE_WITH_LIST
(
list_CREATETABLESPACE
);
}
/* Complete CREATE TABLESPACE name OWNER name with "LOCATION" */
else
if
(
pg_strcasecmp
(
prev5_wd
,
"CREATE"
)
==
0
&&
pg_strcasecmp
(
prev4_wd
,
"TABLESPACE"
)
==
0
&&
pg_strcasecmp
(
prev2_wd
,
"OWNER"
)
==
0
)
{
COMPLETE_WITH_CONST
(
"LOCATION"
);
}
/* CREATE TRIGGER */
/* is on the agenda . . . */
...
...
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