Improve psql tab completion for CREATE/ALTER ROLE [NO]REPLICATION.

Missing support for VALID UNTIL in CREATE ROLE is also added.
This commit is contained in:
Itagaki Takahiro 2011-01-04 17:56:01 +09:00
parent 7f60be72b0
commit 14158f25cd

View File

@ -936,10 +936,11 @@ psql_completion(char *text, int start, int end)
pg_strcasecmp(prev2_wd, "ROLE") == 0)) pg_strcasecmp(prev2_wd, "ROLE") == 0))
{ {
static const char *const list_ALTERUSER[] = static const char *const list_ALTERUSER[] =
{"ENCRYPTED", "UNENCRYPTED", "CREATEDB", "NOCREATEDB", "CREATEUSER", {"CONNECTION LIMIT", "CREATEDB", "CREATEROLE", "CREATEUSER",
"NOCREATEUSER", "CREATEROLE", "NOCREATEROLE", "INHERIT", "NOINHERIT", "ENCRYPTED", "INHERIT", "LOGIN", "NOCREATEDB", "NOCREATEROLE",
"LOGIN", "NOLOGIN", "CONNECTION LIMIT", "VALID UNTIL", "RENAME TO", "NOCREATEUSER", "NOINHERIT", "NOLOGIN", "NOREPLICATION",
"SUPERUSER", "NOSUPERUSER", "SET", "RESET", NULL}; "NOSUPERUSER", "RENAME TO", "REPLICATION", "RESET", "SET",
"SUPERUSER", "UNENCRYPTED", "VALID UNTIL", NULL};
COMPLETE_WITH_LIST(list_ALTERUSER); COMPLETE_WITH_LIST(list_ALTERUSER);
} }
@ -1801,9 +1802,10 @@ psql_completion(char *text, int start, int end)
{ {
static const char *const list_CREATEROLE[] = static const char *const list_CREATEROLE[] =
{"ADMIN", "CONNECTION LIMIT", "CREATEDB", "CREATEROLE", "CREATEUSER", {"ADMIN", "CONNECTION LIMIT", "CREATEDB", "CREATEROLE", "CREATEUSER",
"ENCRYPTED", "IN", "INHERIT", "LOGIN", "NOINHERIT", "NOLOGIN", "NOCREATEDB", "ENCRYPTED", "IN", "INHERIT", "LOGIN", "NOCREATEDB",
"NOCREATEROLE", "NOCREATEUSER", "NOSUPERUSER", "ROLE", "SUPERUSER", "SYSID", "NOCREATEROLE", "NOCREATEUSER", "NOINHERIT", "NOLOGIN",
"UNENCRYPTED", NULL}; "NOREPLICATION", "NOSUPERUSER", "REPLICATION", "ROLE",
"SUPERUSER", "SYSID", "UNENCRYPTED", "VALID UNTIL", NULL};
COMPLETE_WITH_LIST(list_CREATEROLE); COMPLETE_WITH_LIST(list_CREATEROLE);
} }