@@ -199,7 +199,7 @@ static void check_raise_parameters(PLpgSQL_stmt_raise *stmt);
199199%type <stmt> stmt_return stmt_raise stmt_assert stmt_execsql
200200%type <stmt> stmt_dynexecute stmt_for stmt_perform stmt_call stmt_getdiag
201201%type <stmt> stmt_open stmt_fetch stmt_move stmt_close stmt_null
202- %type <stmt> stmt_commit stmt_rollback
202+ %type <stmt> stmt_commit stmt_rollback stmt_set
203203%type <stmt> stmt_case stmt_foreach_a
204204
205205%type <list> proc_exceptions
@@ -327,6 +327,7 @@ static void check_raise_parameters(PLpgSQL_stmt_raise *stmt);
327327%token <keyword> K_QUERY
328328%token <keyword> K_RAISE
329329%token <keyword> K_RELATIVE
330+ %token <keyword> K_RESET
330331%token <keyword> K_RESULT_OID
331332%token <keyword> K_RETURN
332333%token <keyword> K_RETURNED_SQLSTATE
@@ -337,6 +338,7 @@ static void check_raise_parameters(PLpgSQL_stmt_raise *stmt);
337338%token <keyword> K_SCHEMA
338339%token <keyword> K_SCHEMA_NAME
339340%token <keyword> K_SCROLL
341+ %token <keyword> K_SET
340342%token <keyword> K_SLICE
341343%token <keyword> K_SQLSTATE
342344%token <keyword> K_STACKED
@@ -893,6 +895,8 @@ proc_stmt : pl_block ';'
893895 { $$ = $1 ; }
894896 | stmt_rollback
895897 { $$ = $1 ; }
898+ | stmt_set
899+ { $$ = $1 ; }
896900 ;
897901
898902stmt_perform : K_PERFORM expr_until_semi
@@ -2206,6 +2210,30 @@ stmt_rollback : K_ROLLBACK ';'
22062210 }
22072211 ;
22082212
2213+ stmt_set : K_SET
2214+ {
2215+ PLpgSQL_stmt_set *new ;
2216+
2217+ new = palloc0 (sizeof (PLpgSQL_stmt_set));
2218+ new ->cmd_type = PLPGSQL_STMT_SET;
2219+ new ->lineno = plpgsql_location_to_lineno (@1 );
2220+ new ->expr = read_sql_stmt (" SET " );
2221+
2222+ $$ = (PLpgSQL_stmt *)new ;
2223+ }
2224+ | K_RESET
2225+ {
2226+ PLpgSQL_stmt_set *new ;
2227+
2228+ new = palloc0 (sizeof (PLpgSQL_stmt_set));
2229+ new ->cmd_type = PLPGSQL_STMT_SET;
2230+ new ->lineno = plpgsql_location_to_lineno (@1 );
2231+ new ->expr = read_sql_stmt (" RESET " );
2232+
2233+ $$ = (PLpgSQL_stmt *)new ;
2234+ }
2235+ ;
2236+
22092237
22102238cursor_variable : T_DATUM
22112239 {
@@ -2494,6 +2522,7 @@ unreserved_keyword :
24942522 | K_QUERY
24952523 | K_RAISE
24962524 | K_RELATIVE
2525+ | K_RESET
24972526 | K_RESULT_OID
24982527 | K_RETURN
24992528 | K_RETURNED_SQLSTATE
@@ -2504,6 +2533,7 @@ unreserved_keyword :
25042533 | K_SCHEMA
25052534 | K_SCHEMA_NAME
25062535 | K_SCROLL
2536+ | K_SET
25072537 | K_SLICE
25082538 | K_SQLSTATE
25092539 | K_STACKED
0 commit comments