Commit 5ca4dfc7 authored by Robert Haas's avatar Robert Haas

Remove 13 keywords that are used only for ROLE options.

Review by Tom Lane.
parent 01c1a12a
...@@ -489,8 +489,8 @@ static void SplitColQualList(List *qualList, ...@@ -489,8 +489,8 @@ static void SplitColQualList(List *qualList,
CHARACTER CHARACTERISTICS CHECK CHECKPOINT CLASS CLOSE CHARACTER CHARACTERISTICS CHECK CHECKPOINT CLASS CLOSE
CLUSTER COALESCE COLLATE COLLATION COLUMN COMMENT COMMENTS COMMIT CLUSTER COALESCE COLLATE COLLATION COLUMN COMMENT COMMENTS COMMIT
COMMITTED CONCURRENTLY CONFIGURATION CONNECTION CONSTRAINT CONSTRAINTS COMMITTED CONCURRENTLY CONFIGURATION CONNECTION CONSTRAINT CONSTRAINTS
CONTENT_P CONTINUE_P CONVERSION_P COPY COST CREATE CREATEDB CONTENT_P CONTINUE_P CONVERSION_P COPY COST CREATE
CREATEROLE CREATEUSER CROSS CSV CURRENT_P CROSS CSV CURRENT_P
CURRENT_CATALOG CURRENT_DATE CURRENT_ROLE CURRENT_SCHEMA CURRENT_CATALOG CURRENT_DATE CURRENT_ROLE CURRENT_SCHEMA
CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER CURSOR CYCLE CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER CURSOR CYCLE
...@@ -520,13 +520,12 @@ static void SplitColQualList(List *qualList, ...@@ -520,13 +520,12 @@ static void SplitColQualList(List *qualList,
LABEL LANGUAGE LARGE_P LAST_P LC_COLLATE_P LC_CTYPE_P LEADING LABEL LANGUAGE LARGE_P LAST_P LC_COLLATE_P LC_CTYPE_P LEADING
LEAST LEFT LEVEL LIKE LIMIT LISTEN LOAD LOCAL LOCALTIME LOCALTIMESTAMP LEAST LEFT LEVEL LIKE LIMIT LISTEN LOAD LOCAL LOCALTIME LOCALTIMESTAMP
LOCATION LOCK_P LOGIN_P LOCATION LOCK_P
MAPPING MATCH MAXVALUE MINUTE_P MINVALUE MODE MONTH_P MOVE MAPPING MATCH MAXVALUE MINUTE_P MINVALUE MODE MONTH_P MOVE
NAME_P NAMES NATIONAL NATURAL NCHAR NEXT NO NOCREATEDB NAME_P NAMES NATIONAL NATURAL NCHAR NEXT NO NONE
NOCREATEROLE NOCREATEUSER NOINHERIT NOLOGIN_P NONE NOREPLICATION_P NOT NOTHING NOTIFY NOTNULL NOWAIT NULL_P NULLIF
NOSUPERUSER NOT NOTHING NOTIFY NOTNULL NOWAIT NULL_P NULLIF
NULLS_P NUMERIC NULLS_P NUMERIC
OBJECT_P OF OFF OFFSET OIDS ON ONLY OPERATOR OPTION OPTIONS OR OBJECT_P OF OFF OFFSET OIDS ON ONLY OPERATOR OPTION OPTIONS OR
...@@ -539,14 +538,14 @@ static void SplitColQualList(List *qualList, ...@@ -539,14 +538,14 @@ static void SplitColQualList(List *qualList,
QUOTE QUOTE
RANGE READ REAL REASSIGN RECHECK RECURSIVE REF REFERENCES REINDEX RANGE READ REAL REASSIGN RECHECK RECURSIVE REF REFERENCES REINDEX
RELATIVE_P RELEASE RENAME REPEATABLE REPLACE REPLICA REPLICATION_P RELATIVE_P RELEASE RENAME REPEATABLE REPLACE REPLICA
RESET RESTART RESTRICT RETURNING RETURNS REVOKE RIGHT ROLE ROLLBACK RESET RESTART RESTRICT RETURNING RETURNS REVOKE RIGHT ROLE ROLLBACK
ROW ROWS RULE ROW ROWS RULE
SAVEPOINT SCHEMA SCROLL SEARCH SECOND_P SECURITY SELECT SEQUENCE SEQUENCES SAVEPOINT SCHEMA SCROLL SEARCH SECOND_P SECURITY SELECT SEQUENCE SEQUENCES
SERIALIZABLE SERVER SESSION SESSION_USER SET SETOF SHARE SERIALIZABLE SERVER SESSION SESSION_USER SET SETOF SHARE
SHOW SIMILAR SIMPLE SMALLINT SOME STABLE STANDALONE_P START STATEMENT SHOW SIMILAR SIMPLE SMALLINT SOME STABLE STANDALONE_P START STATEMENT
STATISTICS STDIN STDOUT STORAGE STRICT_P STRIP_P SUBSTRING SUPERUSER_P STATISTICS STDIN STDOUT STORAGE STRICT_P STRIP_P SUBSTRING
SYMMETRIC SYSID SYSTEM_P SYMMETRIC SYSID SYSTEM_P
TABLE TABLES TABLESPACE TEMP TEMPLATE TEMPORARY TEXT_P THEN TIME TIMESTAMP TABLE TABLES TABLESPACE TEMP TEMPLATE TEMPORARY TEXT_P THEN TIME TIMESTAMP
...@@ -838,75 +837,73 @@ AlterOptRoleElem: ...@@ -838,75 +837,73 @@ AlterOptRoleElem:
$$ = makeDefElem("unencryptedPassword", $$ = makeDefElem("unencryptedPassword",
(Node *)makeString($3)); (Node *)makeString($3));
} }
| SUPERUSER_P
{
$$ = makeDefElem("superuser", (Node *)makeInteger(TRUE));
}
| NOSUPERUSER
{
$$ = makeDefElem("superuser", (Node *)makeInteger(FALSE));
}
| INHERIT | INHERIT
{ {
$$ = makeDefElem("inherit", (Node *)makeInteger(TRUE)); $$ = makeDefElem("inherit", (Node *)makeInteger(TRUE));
} }
| NOINHERIT | CONNECTION LIMIT SignedIconst
{
$$ = makeDefElem("inherit", (Node *)makeInteger(FALSE));
}
| CREATEDB
{ {
$$ = makeDefElem("createdb", (Node *)makeInteger(TRUE)); $$ = makeDefElem("connectionlimit", (Node *)makeInteger($3));
} }
| NOCREATEDB | VALID UNTIL Sconst
{ {
$$ = makeDefElem("createdb", (Node *)makeInteger(FALSE)); $$ = makeDefElem("validUntil", (Node *)makeString($3));
} }
| CREATEROLE /* Supported but not documented for roles, for use by ALTER GROUP. */
| USER name_list
{ {
$$ = makeDefElem("createrole", (Node *)makeInteger(TRUE)); $$ = makeDefElem("rolemembers", (Node *)$2);
} }
| NOCREATEROLE | IDENT
{ {
$$ = makeDefElem("createrole", (Node *)makeInteger(FALSE)); /*
} * We handle identifiers that aren't parser keywords with
| CREATEUSER * the following special-case codes, to avoid bloating the
* size of the main parser.
*/
if (strcmp($1, "superuser") == 0)
$$ = makeDefElem("superuser", (Node *)makeInteger(TRUE));
else if (strcmp($1, "nosuperuser") == 0)
$$ = makeDefElem("superuser", (Node *)makeInteger(FALSE));
else if (strcmp($1, "createuser") == 0)
{ {
/* For backwards compatibility, synonym for SUPERUSER */ /* For backwards compatibility, synonym for SUPERUSER */
$$ = makeDefElem("superuser", (Node *)makeInteger(TRUE)); $$ = makeDefElem("superuser", (Node *)makeInteger(TRUE));
} }
| NOCREATEUSER else if (strcmp($1, "nocreateuser") == 0)
{ {
/* For backwards compatibility, synonym for SUPERUSER */
$$ = makeDefElem("superuser", (Node *)makeInteger(FALSE)); $$ = makeDefElem("superuser", (Node *)makeInteger(FALSE));
} }
| LOGIN_P else if (strcmp($1, "createrole") == 0)
{ $$ = makeDefElem("createrole", (Node *)makeInteger(TRUE));
$$ = makeDefElem("canlogin", (Node *)makeInteger(TRUE)); else if (strcmp($1, "nocreaterole") == 0)
} $$ = makeDefElem("createrole", (Node *)makeInteger(FALSE));
| NOLOGIN_P else if (strcmp($1, "replication") == 0)
{
$$ = makeDefElem("canlogin", (Node *)makeInteger(FALSE));
}
| REPLICATION_P
{
$$ = makeDefElem("isreplication", (Node *)makeInteger(TRUE)); $$ = makeDefElem("isreplication", (Node *)makeInteger(TRUE));
} else if (strcmp($1, "noreplication") == 0)
| NOREPLICATION_P
{
$$ = makeDefElem("isreplication", (Node *)makeInteger(FALSE)); $$ = makeDefElem("isreplication", (Node *)makeInteger(FALSE));
} else if (strcmp($1, "createdb") == 0)
| CONNECTION LIMIT SignedIconst $$ = makeDefElem("createdb", (Node *)makeInteger(TRUE));
{ else if (strcmp($1, "nocreatedb") == 0)
$$ = makeDefElem("connectionlimit", (Node *)makeInteger($3)); $$ = makeDefElem("createdb", (Node *)makeInteger(FALSE));
} else if (strcmp($1, "login") == 0)
| VALID UNTIL Sconst $$ = makeDefElem("canlogin", (Node *)makeInteger(TRUE));
else if (strcmp($1, "nologin") == 0)
$$ = makeDefElem("canlogin", (Node *)makeInteger(FALSE));
else if (strcmp($1, "noinherit") == 0)
{ {
$$ = makeDefElem("validUntil", (Node *)makeString($3)); /*
* Note that INHERIT is a keyword, so it's handled by main parser, but
* NOINHERIT is handled here.
*/
$$ = makeDefElem("inherit", (Node *)makeInteger(FALSE));
} }
/* Supported but not documented for roles, for use by ALTER GROUP. */ else
| USER name_list ereport(ERROR,
{ (errcode(ERRCODE_SYNTAX_ERROR),
$$ = makeDefElem("rolemembers", (Node *)$2); errmsg("unrecognized role option \"%s\"", $1),
parser_errposition(@1)));
} }
; ;
...@@ -11853,9 +11850,6 @@ unreserved_keyword: ...@@ -11853,9 +11850,6 @@ unreserved_keyword:
| CONVERSION_P | CONVERSION_P
| COPY | COPY
| COST | COST
| CREATEDB
| CREATEROLE
| CREATEUSER
| CSV | CSV
| CURRENT_P | CURRENT_P
| CURSOR | CURSOR
...@@ -11935,7 +11929,6 @@ unreserved_keyword: ...@@ -11935,7 +11929,6 @@ unreserved_keyword:
| LOCAL | LOCAL
| LOCATION | LOCATION
| LOCK_P | LOCK_P
| LOGIN_P
| MAPPING | MAPPING
| MATCH | MATCH
| MAXVALUE | MAXVALUE
...@@ -11948,13 +11941,6 @@ unreserved_keyword: ...@@ -11948,13 +11941,6 @@ unreserved_keyword:
| NAMES | NAMES
| NEXT | NEXT
| NO | NO
| NOCREATEDB
| NOCREATEROLE
| NOCREATEUSER
| NOINHERIT
| NOLOGIN_P
| NOREPLICATION_P
| NOSUPERUSER
| NOTHING | NOTHING
| NOTIFY | NOTIFY
| NOWAIT | NOWAIT
...@@ -11996,7 +11982,6 @@ unreserved_keyword: ...@@ -11996,7 +11982,6 @@ unreserved_keyword:
| REPEATABLE | REPEATABLE
| REPLACE | REPLACE
| REPLICA | REPLICA
| REPLICATION_P
| RESET | RESET
| RESTART | RESTART
| RESTRICT | RESTRICT
...@@ -12031,7 +12016,6 @@ unreserved_keyword: ...@@ -12031,7 +12016,6 @@ unreserved_keyword:
| STORAGE | STORAGE
| STRICT_P | STRICT_P
| STRIP_P | STRIP_P
| SUPERUSER_P
| SYSID | SYSID
| SYSTEM_P | SYSTEM_P
| TABLES | TABLES
......
...@@ -96,9 +96,6 @@ PG_KEYWORD("conversion", CONVERSION_P, UNRESERVED_KEYWORD) ...@@ -96,9 +96,6 @@ PG_KEYWORD("conversion", CONVERSION_P, UNRESERVED_KEYWORD)
PG_KEYWORD("copy", COPY, UNRESERVED_KEYWORD) PG_KEYWORD("copy", COPY, UNRESERVED_KEYWORD)
PG_KEYWORD("cost", COST, UNRESERVED_KEYWORD) PG_KEYWORD("cost", COST, UNRESERVED_KEYWORD)
PG_KEYWORD("create", CREATE, RESERVED_KEYWORD) PG_KEYWORD("create", CREATE, RESERVED_KEYWORD)
PG_KEYWORD("createdb", CREATEDB, UNRESERVED_KEYWORD)
PG_KEYWORD("createrole", CREATEROLE, UNRESERVED_KEYWORD)
PG_KEYWORD("createuser", CREATEUSER, UNRESERVED_KEYWORD)
PG_KEYWORD("cross", CROSS, TYPE_FUNC_NAME_KEYWORD) PG_KEYWORD("cross", CROSS, TYPE_FUNC_NAME_KEYWORD)
PG_KEYWORD("csv", CSV, UNRESERVED_KEYWORD) PG_KEYWORD("csv", CSV, UNRESERVED_KEYWORD)
PG_KEYWORD("current", CURRENT_P, UNRESERVED_KEYWORD) PG_KEYWORD("current", CURRENT_P, UNRESERVED_KEYWORD)
...@@ -230,7 +227,6 @@ PG_KEYWORD("localtime", LOCALTIME, RESERVED_KEYWORD) ...@@ -230,7 +227,6 @@ PG_KEYWORD("localtime", LOCALTIME, RESERVED_KEYWORD)
PG_KEYWORD("localtimestamp", LOCALTIMESTAMP, RESERVED_KEYWORD) PG_KEYWORD("localtimestamp", LOCALTIMESTAMP, RESERVED_KEYWORD)
PG_KEYWORD("location", LOCATION, UNRESERVED_KEYWORD) PG_KEYWORD("location", LOCATION, UNRESERVED_KEYWORD)
PG_KEYWORD("lock", LOCK_P, UNRESERVED_KEYWORD) PG_KEYWORD("lock", LOCK_P, UNRESERVED_KEYWORD)
PG_KEYWORD("login", LOGIN_P, UNRESERVED_KEYWORD)
PG_KEYWORD("mapping", MAPPING, UNRESERVED_KEYWORD) PG_KEYWORD("mapping", MAPPING, UNRESERVED_KEYWORD)
PG_KEYWORD("match", MATCH, UNRESERVED_KEYWORD) PG_KEYWORD("match", MATCH, UNRESERVED_KEYWORD)
PG_KEYWORD("maxvalue", MAXVALUE, UNRESERVED_KEYWORD) PG_KEYWORD("maxvalue", MAXVALUE, UNRESERVED_KEYWORD)
...@@ -246,14 +242,7 @@ PG_KEYWORD("natural", NATURAL, TYPE_FUNC_NAME_KEYWORD) ...@@ -246,14 +242,7 @@ PG_KEYWORD("natural", NATURAL, TYPE_FUNC_NAME_KEYWORD)
PG_KEYWORD("nchar", NCHAR, COL_NAME_KEYWORD) PG_KEYWORD("nchar", NCHAR, COL_NAME_KEYWORD)
PG_KEYWORD("next", NEXT, UNRESERVED_KEYWORD) PG_KEYWORD("next", NEXT, UNRESERVED_KEYWORD)
PG_KEYWORD("no", NO, UNRESERVED_KEYWORD) PG_KEYWORD("no", NO, UNRESERVED_KEYWORD)
PG_KEYWORD("nocreatedb", NOCREATEDB, UNRESERVED_KEYWORD)
PG_KEYWORD("nocreaterole", NOCREATEROLE, UNRESERVED_KEYWORD)
PG_KEYWORD("nocreateuser", NOCREATEUSER, UNRESERVED_KEYWORD)
PG_KEYWORD("noinherit", NOINHERIT, UNRESERVED_KEYWORD)
PG_KEYWORD("nologin", NOLOGIN_P, UNRESERVED_KEYWORD)
PG_KEYWORD("none", NONE, COL_NAME_KEYWORD) PG_KEYWORD("none", NONE, COL_NAME_KEYWORD)
PG_KEYWORD("noreplication", NOREPLICATION_P, UNRESERVED_KEYWORD)
PG_KEYWORD("nosuperuser", NOSUPERUSER, UNRESERVED_KEYWORD)
PG_KEYWORD("not", NOT, RESERVED_KEYWORD) PG_KEYWORD("not", NOT, RESERVED_KEYWORD)
PG_KEYWORD("nothing", NOTHING, UNRESERVED_KEYWORD) PG_KEYWORD("nothing", NOTHING, UNRESERVED_KEYWORD)
PG_KEYWORD("notify", NOTIFY, UNRESERVED_KEYWORD) PG_KEYWORD("notify", NOTIFY, UNRESERVED_KEYWORD)
...@@ -316,7 +305,6 @@ PG_KEYWORD("rename", RENAME, UNRESERVED_KEYWORD) ...@@ -316,7 +305,6 @@ PG_KEYWORD("rename", RENAME, UNRESERVED_KEYWORD)
PG_KEYWORD("repeatable", REPEATABLE, UNRESERVED_KEYWORD) PG_KEYWORD("repeatable", REPEATABLE, UNRESERVED_KEYWORD)
PG_KEYWORD("replace", REPLACE, UNRESERVED_KEYWORD) PG_KEYWORD("replace", REPLACE, UNRESERVED_KEYWORD)
PG_KEYWORD("replica", REPLICA, UNRESERVED_KEYWORD) PG_KEYWORD("replica", REPLICA, UNRESERVED_KEYWORD)
PG_KEYWORD("replication", REPLICATION_P, UNRESERVED_KEYWORD)
PG_KEYWORD("reset", RESET, UNRESERVED_KEYWORD) PG_KEYWORD("reset", RESET, UNRESERVED_KEYWORD)
PG_KEYWORD("restart", RESTART, UNRESERVED_KEYWORD) PG_KEYWORD("restart", RESTART, UNRESERVED_KEYWORD)
PG_KEYWORD("restrict", RESTRICT, UNRESERVED_KEYWORD) PG_KEYWORD("restrict", RESTRICT, UNRESERVED_KEYWORD)
...@@ -361,7 +349,6 @@ PG_KEYWORD("storage", STORAGE, UNRESERVED_KEYWORD) ...@@ -361,7 +349,6 @@ PG_KEYWORD("storage", STORAGE, UNRESERVED_KEYWORD)
PG_KEYWORD("strict", STRICT_P, UNRESERVED_KEYWORD) PG_KEYWORD("strict", STRICT_P, UNRESERVED_KEYWORD)
PG_KEYWORD("strip", STRIP_P, UNRESERVED_KEYWORD) PG_KEYWORD("strip", STRIP_P, UNRESERVED_KEYWORD)
PG_KEYWORD("substring", SUBSTRING, COL_NAME_KEYWORD) PG_KEYWORD("substring", SUBSTRING, COL_NAME_KEYWORD)
PG_KEYWORD("superuser", SUPERUSER_P, UNRESERVED_KEYWORD)
PG_KEYWORD("symmetric", SYMMETRIC, RESERVED_KEYWORD) PG_KEYWORD("symmetric", SYMMETRIC, RESERVED_KEYWORD)
PG_KEYWORD("sysid", SYSID, UNRESERVED_KEYWORD) PG_KEYWORD("sysid", SYSID, UNRESERVED_KEYWORD)
PG_KEYWORD("system", SYSTEM_P, UNRESERVED_KEYWORD) PG_KEYWORD("system", SYSTEM_P, UNRESERVED_KEYWORD)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment