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
5ca4dfc7
Commit
5ca4dfc7
authored
Mar 15, 2011
by
Robert Haas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove 13 keywords that are used only for ROLE options.
Review by Tom Lane.
parent
01c1a12a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
87 deletions
+58
-87
src/backend/parser/gram.y
src/backend/parser/gram.y
+58
-74
src/include/parser/kwlist.h
src/include/parser/kwlist.h
+0
-13
No files found.
src/backend/parser/gram.y
View file @
5ca4dfc7
...
...
@@ -489,8 +489,8 @@ static void SplitColQualList(List *qualList,
CHARACTER CHARACTERISTICS CHECK CHECKPOINT CLASS CLOSE
CLUSTER COALESCE COLLATE COLLATION COLUMN COMMENT COMMENTS COMMIT
COMMITTED CONCURRENTLY CONFIGURATION CONNECTION CONSTRAINT CONSTRAINTS
CONTENT_P CONTINUE_P CONVERSION_P COPY COST CREATE
CREATEDB
CR
EATEROLE CREATEUSER CR
OSS CSV CURRENT_P
CONTENT_P CONTINUE_P CONVERSION_P COPY COST CREATE
CROSS CSV CURRENT_P
CURRENT_CATALOG CURRENT_DATE CURRENT_ROLE CURRENT_SCHEMA
CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER CURSOR CYCLE
...
...
@@ -520,13 +520,12 @@ static void SplitColQualList(List *qualList,
LABEL LANGUAGE LARGE_P LAST_P LC_COLLATE_P LC_CTYPE_P LEADING
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
NAME_P NAMES NATIONAL NATURAL NCHAR NEXT NO NOCREATEDB
NOCREATEROLE NOCREATEUSER NOINHERIT NOLOGIN_P NONE NOREPLICATION_P
NOSUPERUSER NOT NOTHING NOTIFY NOTNULL NOWAIT NULL_P NULLIF
NAME_P NAMES NATIONAL NATURAL NCHAR NEXT NO NONE
NOT NOTHING NOTIFY NOTNULL NOWAIT NULL_P NULLIF
NULLS_P NUMERIC
OBJECT_P OF OFF OFFSET OIDS ON ONLY OPERATOR OPTION OPTIONS OR
...
...
@@ -539,14 +538,14 @@ static void SplitColQualList(List *qualList,
QUOTE
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
ROW ROWS RULE
SAVEPOINT SCHEMA SCROLL SEARCH SECOND_P SECURITY SELECT SEQUENCE SEQUENCES
SERIALIZABLE SERVER SESSION SESSION_USER SET SETOF SHARE
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
TABLE TABLES TABLESPACE TEMP TEMPLATE TEMPORARY TEXT_P THEN TIME TIMESTAMP
...
...
@@ -838,63 +837,10 @@ AlterOptRoleElem:
$$ = makeDefElem("unencryptedPassword",
(Node *)makeString($3));
}
| SUPERUSER_P
{
$$ = makeDefElem("superuser", (Node *)makeInteger(TRUE));
}
| NOSUPERUSER
{
$$ = makeDefElem("superuser", (Node *)makeInteger(FALSE));
}
| INHERIT
{
$$ = makeDefElem("inherit", (Node *)makeInteger(TRUE));
}
| NOINHERIT
{
$$ = makeDefElem("inherit", (Node *)makeInteger(FALSE));
}
| CREATEDB
{
$$ = makeDefElem("createdb", (Node *)makeInteger(TRUE));
}
| NOCREATEDB
{
$$ = makeDefElem("createdb", (Node *)makeInteger(FALSE));
}
| CREATEROLE
{
$$ = makeDefElem("createrole", (Node *)makeInteger(TRUE));
}
| NOCREATEROLE
{
$$ = makeDefElem("createrole", (Node *)makeInteger(FALSE));
}
| CREATEUSER
{
/* For backwards compatibility, synonym for SUPERUSER */
$$ = makeDefElem("superuser", (Node *)makeInteger(TRUE));
}
| NOCREATEUSER
{
$$ = makeDefElem("superuser", (Node *)makeInteger(FALSE));
}
| LOGIN_P
{
$$ = makeDefElem("canlogin", (Node *)makeInteger(TRUE));
}
| NOLOGIN_P
{
$$ = makeDefElem("canlogin", (Node *)makeInteger(FALSE));
}
| REPLICATION_P
{
$$ = makeDefElem("isreplication", (Node *)makeInteger(TRUE));
}
| NOREPLICATION_P
{
$$ = makeDefElem("isreplication", (Node *)makeInteger(FALSE));
}
| CONNECTION LIMIT SignedIconst
{
$$ = makeDefElem("connectionlimit", (Node *)makeInteger($3));
...
...
@@ -908,6 +854,57 @@ AlterOptRoleElem:
{
$$ = makeDefElem("rolemembers", (Node *)$2);
}
| IDENT
{
/*
* We handle identifiers that aren't parser keywords with
* 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 */
$$ = makeDefElem("superuser", (Node *)makeInteger(TRUE));
}
else if (strcmp($1, "nocreateuser") == 0)
{
/* For backwards compatibility, synonym for SUPERUSER */
$$ = makeDefElem("superuser", (Node *)makeInteger(FALSE));
}
else if (strcmp($1, "createrole") == 0)
$$ = makeDefElem("createrole", (Node *)makeInteger(TRUE));
else if (strcmp($1, "nocreaterole") == 0)
$$ = makeDefElem("createrole", (Node *)makeInteger(FALSE));
else if (strcmp($1, "replication") == 0)
$$ = makeDefElem("isreplication", (Node *)makeInteger(TRUE));
else if (strcmp($1, "noreplication") == 0)
$$ = makeDefElem("isreplication", (Node *)makeInteger(FALSE));
else if (strcmp($1, "createdb") == 0)
$$ = makeDefElem("createdb", (Node *)makeInteger(TRUE));
else if (strcmp($1, "nocreatedb") == 0)
$$ = makeDefElem("createdb", (Node *)makeInteger(FALSE));
else if (strcmp($1, "login") == 0)
$$ = makeDefElem("canlogin", (Node *)makeInteger(TRUE));
else if (strcmp($1, "nologin") == 0)
$$ = makeDefElem("canlogin", (Node *)makeInteger(FALSE));
else if (strcmp($1, "noinherit") == 0)
{
/*
* Note that INHERIT is a keyword, so it's handled by main parser, but
* NOINHERIT is handled here.
*/
$$ = makeDefElem("inherit", (Node *)makeInteger(FALSE));
}
else
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("unrecognized role option \"%s\"", $1),
parser_errposition(@1)));
}
;
CreateOptRoleElem:
...
...
@@ -11853,9 +11850,6 @@ unreserved_keyword:
| CONVERSION_P
| COPY
| COST
| CREATEDB
| CREATEROLE
| CREATEUSER
| CSV
| CURRENT_P
| CURSOR
...
...
@@ -11935,7 +11929,6 @@ unreserved_keyword:
| LOCAL
| LOCATION
| LOCK_P
| LOGIN_P
| MAPPING
| MATCH
| MAXVALUE
...
...
@@ -11948,13 +11941,6 @@ unreserved_keyword:
| NAMES
| NEXT
| NO
| NOCREATEDB
| NOCREATEROLE
| NOCREATEUSER
| NOINHERIT
| NOLOGIN_P
| NOREPLICATION_P
| NOSUPERUSER
| NOTHING
| NOTIFY
| NOWAIT
...
...
@@ -11996,7 +11982,6 @@ unreserved_keyword:
| REPEATABLE
| REPLACE
| REPLICA
| REPLICATION_P
| RESET
| RESTART
| RESTRICT
...
...
@@ -12031,7 +12016,6 @@ unreserved_keyword:
| STORAGE
| STRICT_P
| STRIP_P
| SUPERUSER_P
| SYSID
| SYSTEM_P
| TABLES
...
...
src/include/parser/kwlist.h
View file @
5ca4dfc7
...
...
@@ -96,9 +96,6 @@ PG_KEYWORD("conversion", CONVERSION_P, UNRESERVED_KEYWORD)
PG_KEYWORD
(
"copy"
,
COPY
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"cost"
,
COST
,
UNRESERVED_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
(
"csv"
,
CSV
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"current"
,
CURRENT_P
,
UNRESERVED_KEYWORD
)
...
...
@@ -230,7 +227,6 @@ PG_KEYWORD("localtime", LOCALTIME, RESERVED_KEYWORD)
PG_KEYWORD
(
"localtimestamp"
,
LOCALTIMESTAMP
,
RESERVED_KEYWORD
)
PG_KEYWORD
(
"location"
,
LOCATION
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"lock"
,
LOCK_P
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"login"
,
LOGIN_P
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"mapping"
,
MAPPING
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"match"
,
MATCH
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"maxvalue"
,
MAXVALUE
,
UNRESERVED_KEYWORD
)
...
...
@@ -246,14 +242,7 @@ PG_KEYWORD("natural", NATURAL, TYPE_FUNC_NAME_KEYWORD)
PG_KEYWORD
(
"nchar"
,
NCHAR
,
COL_NAME_KEYWORD
)
PG_KEYWORD
(
"next"
,
NEXT
,
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
(
"noreplication"
,
NOREPLICATION_P
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"nosuperuser"
,
NOSUPERUSER
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"not"
,
NOT
,
RESERVED_KEYWORD
)
PG_KEYWORD
(
"nothing"
,
NOTHING
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"notify"
,
NOTIFY
,
UNRESERVED_KEYWORD
)
...
...
@@ -316,7 +305,6 @@ PG_KEYWORD("rename", RENAME, UNRESERVED_KEYWORD)
PG_KEYWORD
(
"repeatable"
,
REPEATABLE
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"replace"
,
REPLACE
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"replica"
,
REPLICA
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"replication"
,
REPLICATION_P
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"reset"
,
RESET
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"restart"
,
RESTART
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"restrict"
,
RESTRICT
,
UNRESERVED_KEYWORD
)
...
...
@@ -361,7 +349,6 @@ PG_KEYWORD("storage", STORAGE, UNRESERVED_KEYWORD)
PG_KEYWORD
(
"strict"
,
STRICT_P
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"strip"
,
STRIP_P
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"substring"
,
SUBSTRING
,
COL_NAME_KEYWORD
)
PG_KEYWORD
(
"superuser"
,
SUPERUSER_P
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"symmetric"
,
SYMMETRIC
,
RESERVED_KEYWORD
)
PG_KEYWORD
(
"sysid"
,
SYSID
,
UNRESERVED_KEYWORD
)
PG_KEYWORD
(
"system"
,
SYSTEM_P
,
UNRESERVED_KEYWORD
)
...
...
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