@@ -428,7 +428,7 @@ static Node *makeIsNotDistinctFromNode(Node *expr, int position);
428428%type <node> overlay_placing substr_from substr_for
429429
430430%type <boolean> opt_instead
431- %type <boolean> opt_unique opt_concurrently opt_verbose opt_full
431+ %type <boolean> opt_unique opt_concurrently opt_verbose opt_full opt_skip_locked
432432%type <boolean> opt_freeze opt_default opt_ordered opt_recheck
433433%type <boolean> opt_rootonly_all
434434%type <boolean> opt_dxl
@@ -753,6 +753,8 @@ static Node *makeIsNotDistinctFromNode(Node *expr, int position);
753753
754754 YEZZEY
755755
756+ SKIP_LOCKED
757+
756758
757759/*
758760 * The grammar thinks these are keywords, but they are not in the kwlist.h
@@ -1111,6 +1113,7 @@ static Node *makeIsNotDistinctFromNode(Node *expr, int position);
11111113 %nonassoc VERBOSE
11121114 %nonassoc UNKNOWN
11131115 %nonassoc ZONE
1116+ %nonassoc SKIP_LOCKED
11141117
11151118
11161119
@@ -11433,13 +11436,15 @@ vacuum_option_elem:
1143311436 ;
1143411437
1143511438AnalyzeStmt :
11436- analyze_keyword opt_verbose opt_rootonly_all
11439+ analyze_keyword opt_verbose opt_skip_locked opt_rootonly_all
1143711440 {
1143811441 VacuumStmt *n = makeNode(VacuumStmt);
1143911442 n->options = VACOPT_ANALYZE;
1144011443 if ($2 )
1144111444 n->options |= VACOPT_VERBOSE;
1144211445 if ($3 )
11446+ n->options |= VACOPT_NOWAIT;
11447+ if ($4 )
1144311448 n->options |= VACOPT_ROOTONLY;
1144411449 n->freeze_min_age = -1 ;
1144511450 n->freeze_table_age = -1 ;
@@ -11449,42 +11454,48 @@ AnalyzeStmt:
1144911454 n->va_cols = NIL;
1145011455 $$ = (Node *)n;
1145111456 }
11452- | analyze_keyword opt_verbose qualified_name opt_name_list
11457+ | analyze_keyword opt_verbose opt_skip_locked qualified_name opt_name_list
1145311458 {
1145411459 VacuumStmt *n = makeNode(VacuumStmt);
1145511460 n->options = VACOPT_ANALYZE;
1145611461 if ($2 )
1145711462 n->options |= VACOPT_VERBOSE;
11463+ if ($3 )
11464+ n->options |= VACOPT_NOWAIT;
1145811465 n->freeze_min_age = -1 ;
1145911466 n->freeze_table_age = -1 ;
1146011467 n->multixact_freeze_min_age = -1 ;
1146111468 n->multixact_freeze_table_age = -1 ;
11462- n->relation = $3 ;
11463- n->va_cols = $4 ;
11469+ n->relation = $4 ;
11470+ n->va_cols = $5 ;
1146411471 $$ = (Node *)n;
1146511472 }
11466- | analyze_keyword opt_verbose FULLSCAN qualified_name opt_name_list
11473+ | analyze_keyword opt_verbose opt_skip_locked FULLSCAN qualified_name opt_name_list
1146711474 {
1146811475 VacuumStmt *n = makeNode(VacuumStmt);
1146911476 n->options = VACOPT_ANALYZE;
1147011477 if ($2 )
1147111478 n->options |= VACOPT_VERBOSE;
11479+ if ($3 )
11480+ n->options |= VACOPT_NOWAIT;
1147211481 n->options |= VACOPT_FULLSCAN;
1147311482 n->freeze_min_age = -1 ;
11474- n->relation = $4 ;
11475- n->va_cols = $5 ;
11483+ n->relation = $5 ;
11484+ n->va_cols = $6 ;
1147611485 $$ = (Node *)n;
1147711486 }
11478- | analyze_keyword opt_verbose ROOTPARTITION qualified_name opt_name_list
11487+ | analyze_keyword opt_verbose opt_skip_locked ROOTPARTITION qualified_name opt_name_list
1147911488 {
1148011489 VacuumStmt *n = makeNode(VacuumStmt);
1148111490 n->options = VACOPT_ANALYZE;
1148211491 if ($2 )
1148311492 n->options |= VACOPT_VERBOSE;
11493+ if ($3 )
11494+ n->options |= VACOPT_NOWAIT;
1148411495 n->options |= VACOPT_ROOTONLY;
1148511496 n->freeze_min_age = -1 ;
11486- n->relation = $4 ;
11487- n->va_cols = $5 ;
11497+ n->relation = $5 ;
11498+ n->va_cols = $6 ;
1148811499 $$ = (Node *)n;
1148911500 }
1149011501 ;
@@ -11512,6 +11523,9 @@ opt_freeze: FREEZE { $$ = TRUE; }
1151211523 | /* EMPTY*/ { $$ = FALSE ; }
1151311524 ;
1151411525
11526+ opt_skip_locked : SKIP_LOCKED { $$ = TRUE ; }
11527+ | /* EMPTY*/ { $$ = FALSE ; }
11528+ ;
1151511529opt_name_list :
1151611530 ' (' name_list ' )' { $$ = $2 ; }
1151711531 | /* EMPTY*/ { $$ = NIL; }
0 commit comments