summaryrefslogtreecommitdiff
path: root/src/backend/bootstrap/bootparse.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/bootstrap/bootparse.y')
-rw-r--r--src/backend/bootstrap/bootparse.y47
1 files changed, 31 insertions, 16 deletions
diff --git a/src/backend/bootstrap/bootparse.y b/src/backend/bootstrap/bootparse.y
index 1ec0e5c8a9c..4c72989cc25 100644
--- a/src/backend/bootstrap/bootparse.y
+++ b/src/backend/bootstrap/bootparse.y
@@ -105,6 +105,7 @@ static int num_columns_read = 0;
List *list;
IndexElem *ielem;
char *str;
+ const char *kw;
int ival;
Oid oidval;
}
@@ -116,17 +117,17 @@ static int num_columns_read = 0;
%type <oidval> oidspec optoideq optrowtypeoid
%token <str> ID
-%token OPEN XCLOSE XCREATE INSERT_TUPLE
-%token XDECLARE INDEX ON USING XBUILD INDICES UNIQUE XTOAST
%token COMMA EQUALS LPAREN RPAREN
-%token OBJ_ID XBOOTSTRAP XSHARED_RELATION XWITHOUT_OIDS XROWTYPE_OID NULLVAL
-%token XFORCE XNOT XNULL
+/* NULLVAL is a reserved keyword */
+%token NULLVAL
+/* All the rest are unreserved, and should be handled in boot_ident! */
+%token <kw> OPEN XCLOSE XCREATE INSERT_TUPLE
+%token <kw> XDECLARE INDEX ON USING XBUILD INDICES UNIQUE XTOAST
+%token <kw> OBJ_ID XBOOTSTRAP XSHARED_RELATION XWITHOUT_OIDS XROWTYPE_OID
+%token <kw> XFORCE XNOT XNULL
%start TopLevel
-%nonassoc low
-%nonassoc high
-
%%
TopLevel:
@@ -160,18 +161,12 @@ Boot_OpenStmt:
;
Boot_CloseStmt:
- XCLOSE boot_ident %prec low
+ XCLOSE boot_ident
{
do_start();
closerel($2);
do_end();
}
- | XCLOSE %prec high
- {
- do_start();
- closerel(NULL);
- do_end();
- }
;
Boot_CreateStmt:
@@ -489,8 +484,28 @@ boot_column_val:
{ InsertOneNull(num_columns_read++); }
;
-boot_ident :
- ID { $$ = yylval.str; }
+boot_ident:
+ ID { $$ = $1; }
+ | OPEN { $$ = pstrdup($1); }
+ | XCLOSE { $$ = pstrdup($1); }
+ | XCREATE { $$ = pstrdup($1); }
+ | INSERT_TUPLE { $$ = pstrdup($1); }
+ | XDECLARE { $$ = pstrdup($1); }
+ | INDEX { $$ = pstrdup($1); }
+ | ON { $$ = pstrdup($1); }
+ | USING { $$ = pstrdup($1); }
+ | XBUILD { $$ = pstrdup($1); }
+ | INDICES { $$ = pstrdup($1); }
+ | UNIQUE { $$ = pstrdup($1); }
+ | XTOAST { $$ = pstrdup($1); }
+ | OBJ_ID { $$ = pstrdup($1); }
+ | XBOOTSTRAP { $$ = pstrdup($1); }
+ | XSHARED_RELATION { $$ = pstrdup($1); }
+ | XWITHOUT_OIDS { $$ = pstrdup($1); }
+ | XROWTYPE_OID { $$ = pstrdup($1); }
+ | XFORCE { $$ = pstrdup($1); }
+ | XNOT { $$ = pstrdup($1); }
+ | XNULL { $$ = pstrdup($1); }
;
%%