%type <ival> Iconst SignedIconst
%type <str> Sconst comment_text notify_payload
-%type <str> RoleId opt_granted_by opt_boolean_or_string ColId_or_Sconst
+%type <str> RoleId opt_granted_by opt_boolean_or_string
%type <list> var_list
%type <str> ColId ColLabel var_name type_function_name param_name
+%type <str> NonReservedWord NonReservedWord_or_Sconst
%type <node> var_value zone_value
%type <keyword> unreserved_keyword type_func_name_keyword
n->kind = VAR_SET_DEFAULT;
$$ = n;
}
- | ROLE ColId_or_Sconst
+ | ROLE NonReservedWord_or_Sconst
{
VariableSetStmt *n = makeNode(VariableSetStmt);
n->kind = VAR_SET_VALUE;
n->args = list_make1(makeStringConst($2, @2));
$$ = n;
}
- | SESSION AUTHORIZATION ColId_or_Sconst
+ | SESSION AUTHORIZATION NonReservedWord_or_Sconst
{
VariableSetStmt *n = makeNode(VariableSetStmt);
n->kind = VAR_SET_VALUE;
| FALSE_P { $$ = "false"; }
| ON { $$ = "on"; }
/*
- * OFF is also accepted as a boolean value, but is handled
- * by the ColId rule below. The action for booleans and strings
+ * OFF is also accepted as a boolean value, but is handled by
+ * the NonReservedWord rule. The action for booleans and strings
* is the same, so we don't need to distinguish them here.
*/
- | ColId_or_Sconst { $$ = $1; }
+ | NonReservedWord_or_Sconst { $$ = $1; }
;
/* Timezone values can be:
| /*EMPTY*/ { $$ = NULL; }
;
-ColId_or_Sconst:
- ColId { $$ = $1; }
+NonReservedWord_or_Sconst:
+ NonReservedWord { $$ = $1; }
| Sconst { $$ = $1; }
;
*****************************************************************************/
CreatePLangStmt:
- CREATE opt_or_replace opt_trusted opt_procedural LANGUAGE ColId_or_Sconst
+ CREATE opt_or_replace opt_trusted opt_procedural LANGUAGE NonReservedWord_or_Sconst
{
CreatePLangStmt *n = makeNode(CreatePLangStmt);
n->replace = $2;
n->pltrusted = false;
$$ = (Node *)n;
}
- | CREATE opt_or_replace opt_trusted opt_procedural LANGUAGE ColId_or_Sconst
+ | CREATE opt_or_replace opt_trusted opt_procedural LANGUAGE NonReservedWord_or_Sconst
HANDLER handler_name opt_inline_handler opt_validator
{
CreatePLangStmt *n = makeNode(CreatePLangStmt);
;
DropPLangStmt:
- DROP opt_procedural LANGUAGE ColId_or_Sconst opt_drop_behavior
+ DROP opt_procedural LANGUAGE NonReservedWord_or_Sconst opt_drop_behavior
{
DropStmt *n = makeNode(DropStmt);
n->removeType = OBJECT_LANGUAGE;
n->concurrent = false;
$$ = (Node *)n;
}
- | DROP opt_procedural LANGUAGE IF_P EXISTS ColId_or_Sconst opt_drop_behavior
+ | DROP opt_procedural LANGUAGE IF_P EXISTS NonReservedWord_or_Sconst opt_drop_behavior
{
DropStmt *n = makeNode(DropStmt);
n->removeType = OBJECT_LANGUAGE;
{
$$ = makeDefElem("schema", (Node *)makeString($2));
}
- | VERSION_P ColId_or_Sconst
+ | VERSION_P NonReservedWord_or_Sconst
{
$$ = makeDefElem("new_version", (Node *)makeString($2));
}
- | FROM ColId_or_Sconst
+ | FROM NonReservedWord_or_Sconst
{
$$ = makeDefElem("old_version", (Node *)makeString($2));
}
;
alter_extension_opt_item:
- TO ColId_or_Sconst
+ TO NonReservedWord_or_Sconst
{
$$ = makeDefElem("new_version", (Node *)makeString($2));
}
}
;
-opt_provider: FOR ColId_or_Sconst { $$ = $2; }
- | /* empty */ { $$ = NULL; }
+opt_provider: FOR NonReservedWord_or_Sconst { $$ = $2; }
+ | /* empty */ { $$ = NULL; }
;
security_label_type:
{
$$ = makeDefElem("as", (Node *)$2);
}
- | LANGUAGE ColId_or_Sconst
+ | LANGUAGE NonReservedWord_or_Sconst
{
$$ = makeDefElem("language", (Node *)makeString($2));
}
{
$$ = makeDefElem("as", (Node *)makeString($1));
}
- | LANGUAGE ColId_or_Sconst
+ | LANGUAGE NonReservedWord_or_Sconst
{
$$ = makeDefElem("language", (Node *)makeString($2));
}
;
explain_option_name:
- ColId { $$ = $1; }
- | analyze_keyword { $$ = "analyze"; }
- | VERBOSE { $$ = "verbose"; }
+ NonReservedWord { $$ = $1; }
;
explain_option_arg:
Iconst: ICONST { $$ = $1; };
Sconst: SCONST { $$ = $1; };
-RoleId: ColId { $$ = $1; };
+RoleId: NonReservedWord { $$ = $1; };
SignedIconst: Iconst { $$ = $1; }
| '+' Iconst { $$ = + $2; }
| type_func_name_keyword { $$ = pstrdup($1); }
;
+/* Any not-fully-reserved word --- these names can be, eg, role names.
+ */
+NonReservedWord: IDENT { $$ = $1; }
+ | unreserved_keyword { $$ = pstrdup($1); }
+ | col_name_keyword { $$ = pstrdup($1); }
+ | type_func_name_keyword { $$ = pstrdup($1); }
+ ;
+
/* Column label --- allowed labels in "AS" clauses.
* This presently includes *all* Postgres keywords.
*/