index 50ed8716ca863f96001ff943945989150f97e0a9..de91ccc2147602d44967083a27157155c768c647 100644 (file)
@@ -401,7 +401,7 @@ static TypeName *TableFuncTypeName(List *columns);
%type <ival> Iconst SignedIconst
%type <str> Sconst comment_text notify_payload
-%type <str> RoleId opt_granted_by opt_boolean ColId_or_Sconst
+%type <str> RoleId opt_granted_by opt_boolean_or_string ColId_or_Sconst
%type <list> var_list
%type <str> ColId ColLabel var_name type_function_name param_name
%type <node> var_value zone_value
| var_list ',' var_value { $$ = lappend(1,ドル 3ドル); }
;
-var_value: opt_boolean
- { $$ = makeStringConst(1,ドル @1); }
- | ColId_or_Sconst
+var_value: opt_boolean_or_string
{ $$ = makeStringConst(1,ドル @1); }
| NumericOnly
{ $$ = makeAConst(1,ドル @1); }
@@ -1334,11 +1332,16 @@ iso_level: READ UNCOMMITTED { $$ = "read uncommitted"; }
| SERIALIZABLE { $$ = "serializable"; }
;
-opt_boolean:
+opt_boolean_or_string:
TRUE_P { $$ = "true"; }
| FALSE_P { $$ = "false"; }
| ON { $$ = "on"; }
- | OFF { $$ = "off"; }
+ /*
+ * OFF is also accepted as a boolean value, but is handled
+ * by the ColId rule below. The action for booleans and strings
+ * is the same, so we don't need to distinguish them here.
+ */
+ | ColId_or_Sconst { $$ = 1ドル }
;
/* Timezone values can be:
;
copy_generic_opt_arg:
- opt_boolean { $$ = (Node *) makeString(1ドル); }
- | ColId_or_Sconst { $$ = (Node *) makeString(1ドル); }
+ opt_boolean_or_string { $$ = (Node *) makeString(1ドル); }
| NumericOnly { $$ = (Node *) 1ドル; }
| '*' { $$ = (Node *) makeNode(A_Star); }
| '(' copy_generic_opt_arg_list ')' { $$ = (Node *) 2ドル; }
/* beware of emitting non-string list elements here; see commands/define.c */
copy_generic_opt_arg_list_item:
- opt_boolean { $$ = (Node *) makeString(1ドル); }
- | ColId_or_Sconst { $$ = (Node *) makeString(1ドル); }
+ opt_boolean_or_string { $$ = (Node *) makeString(1ドル); }
;
;
explain_option_arg:
- opt_boolean { $$ = (Node *) makeString(1ドル); }
- | ColId_or_Sconst { $$ = (Node *) makeString(1ドル); }
+ opt_boolean_or_string { $$ = (Node *) makeString(1ドル); }
| NumericOnly { $$ = (Node *) 1ドル; }
| /* EMPTY */ { $$ = NULL; }
;
| NULLS_P
| OBJECT_P
| OF
+ | OFF
| OIDS
| OPERATOR
| OPTION
| LOCALTIMESTAMP
| NOT
| NULL_P
- | OFF
| OFFSET
| ON
| ONLY
index 5065bd609e9a36069a9d40e75f8727526799ef52..ad835d9a7d3c81a71601995737580788df92a606 100644 (file)
@@ -260,7 +260,7 @@ PG_KEYWORD("nulls", NULLS_P, UNRESERVED_KEYWORD)
PG_KEYWORD("numeric", NUMERIC, COL_NAME_KEYWORD)
PG_KEYWORD("object", OBJECT_P, UNRESERVED_KEYWORD)
PG_KEYWORD("of", OF, UNRESERVED_KEYWORD)
-PG_KEYWORD("off", OFF, RESERVED_KEYWORD)
+PG_KEYWORD("off", OFF, UNRESERVED_KEYWORD)
PG_KEYWORD("offset", OFFSET, RESERVED_KEYWORD)
PG_KEYWORD("oids", OIDS, UNRESERVED_KEYWORD)
PG_KEYWORD("on", ON, RESERVED_KEYWORD)