@@ -199,7 +199,7 @@ static void check_raise_parameters(PLpgSQL_stmt_raise *stmt);
199
199
%type <stmt> stmt_return stmt_raise stmt_assert stmt_execsql
200
200
%type <stmt> stmt_dynexecute stmt_for stmt_perform stmt_call stmt_getdiag
201
201
%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
203
203
%type <stmt> stmt_case stmt_foreach_a
204
204
205
205
%type <list> proc_exceptions
@@ -327,6 +327,7 @@ static void check_raise_parameters(PLpgSQL_stmt_raise *stmt);
327
327
%token <keyword> K_QUERY
328
328
%token <keyword> K_RAISE
329
329
%token <keyword> K_RELATIVE
330
+ %token <keyword> K_RESET
330
331
%token <keyword> K_RESULT_OID
331
332
%token <keyword> K_RETURN
332
333
%token <keyword> K_RETURNED_SQLSTATE
@@ -337,6 +338,7 @@ static void check_raise_parameters(PLpgSQL_stmt_raise *stmt);
337
338
%token <keyword> K_SCHEMA
338
339
%token <keyword> K_SCHEMA_NAME
339
340
%token <keyword> K_SCROLL
341
+ %token <keyword> K_SET
340
342
%token <keyword> K_SLICE
341
343
%token <keyword> K_SQLSTATE
342
344
%token <keyword> K_STACKED
@@ -893,6 +895,8 @@ proc_stmt : pl_block ';'
893
895
{ $$ = $1 ; }
894
896
| stmt_rollback
895
897
{ $$ = $1 ; }
898
+ | stmt_set
899
+ { $$ = $1 ; }
896
900
;
897
901
898
902
stmt_perform : K_PERFORM expr_until_semi
@@ -2206,6 +2210,30 @@ stmt_rollback : K_ROLLBACK ';'
2206
2210
}
2207
2211
;
2208
2212
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
+
2209
2237
2210
2238
cursor_variable : T_DATUM
2211
2239
{
@@ -2494,6 +2522,7 @@ unreserved_keyword :
2494
2522
| K_QUERY
2495
2523
| K_RAISE
2496
2524
| K_RELATIVE
2525
+ | K_RESET
2497
2526
| K_RESULT_OID
2498
2527
| K_RETURN
2499
2528
| K_RETURNED_SQLSTATE
@@ -2504,6 +2533,7 @@ unreserved_keyword :
2504
2533
| K_SCHEMA
2505
2534
| K_SCHEMA_NAME
2506
2535
| K_SCROLL
2536
+ | K_SET
2507
2537
| K_SLICE
2508
2538
| K_SQLSTATE
2509
2539
| K_STACKED
0 commit comments