@@ -656,6 +656,11 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
656
656
657
657
%type <ival> json_encoding
658
658
json_encoding_clause_opt
659
+ json_table_plan_clause_opt
660
+ json_table_default_plan
661
+ json_table_default_plan_choices
662
+ json_table_default_plan_inner_outer
663
+ json_table_default_plan_union_cross
659
664
json_wrapper_clause_opt
660
665
json_wrapper_behavior
661
666
json_conditional_or_unconditional_opt
@@ -769,7 +774,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
769
774
ORDER ORDINALITY OTHERS OUT_P OUTER_P
770
775
OVER OVERLAPS OVERLAY OVERRIDING OWNED OWNER
771
776
772
- PARALLEL PARSER PARTIAL PARTITION PASSING PASSWORD PATH PLACING PLANS POLICY
777
+ PARALLEL PARSER PARTIAL PARTITION PASSING PASSWORD PATH PLACING PLAN PLANS POLICY
773
778
POSITION PRECEDING PRECISION PRESERVE PREPARE PREPARED PRIMARY
774
779
PRIOR PRIVILEGES PROCEDURAL PROCEDURE PROCEDURES PROGRAM PUBLICATION
775
780
@@ -15130,13 +15135,15 @@ json_table:
15130
15135
JSON_TABLE ' ('
15131
15136
json_api_common_syntax
15132
15137
json_table_columns_clause
15138
+ json_table_plan_clause_opt
15133
15139
json_table_error_clause_opt
15134
15140
' )'
15135
15141
{
15136
15142
JsonTable *n = makeNode (JsonTable);
15137
15143
n->common = (JsonCommon *) $3 ;
15138
15144
n->columns = $4 ;
15139
- n->on_error = $5 ;
15145
+ n->join_type = $5 ;
15146
+ n->on_error = $6 ;
15140
15147
n->location = @1 ;
15141
15148
$$ = (Node *) n;
15142
15149
}
@@ -15273,6 +15280,34 @@ path_opt:
15273
15280
| /* EMPTY */ { }
15274
15281
;
15275
15282
15283
+ json_table_plan_clause_opt:
15284
+ json_table_default_plan { $$ = $1 ; }
15285
+ | /* EMPTY */ { $$ = JSTP_OUTER | JSTP_UNION; }
15286
+ ;
15287
+
15288
+ json_table_default_plan:
15289
+ PLAN DEFAULT ' (' json_table_default_plan_choices ' )' { $$ = $4 ; }
15290
+ ;
15291
+
15292
+ json_table_default_plan_choices:
15293
+ json_table_default_plan_inner_outer { $$ = $1 | JSTP_UNION; }
15294
+ | json_table_default_plan_inner_outer ' ,'
15295
+ json_table_default_plan_union_cross { $$ = $1 | $3 ; }
15296
+ | json_table_default_plan_union_cross { $$ = $1 | JSTP_OUTER; }
15297
+ | json_table_default_plan_union_cross ' ,'
15298
+ json_table_default_plan_inner_outer { $$ = $1 | $3 ; }
15299
+ ;
15300
+
15301
+ json_table_default_plan_inner_outer:
15302
+ INNER_P { $$ = JSTP_INNER; }
15303
+ | OUTER_P { $$ = JSTP_OUTER; }
15304
+ ;
15305
+
15306
+ json_table_default_plan_union_cross:
15307
+ UNION { $$ = JSTP_UNION; }
15308
+ | CROSS { $$ = JSTP_CROSS; }
15309
+ ;
15310
+
15276
15311
json_returning_clause_opt:
15277
15312
RETURNING Typename
15278
15313
{
@@ -16088,6 +16123,7 @@ unreserved_keyword:
16088
16123
| PASSING
16089
16124
| PASSWORD
16090
16125
| PATH
16126
+ | PLAN
16091
16127
| PLANS
16092
16128
| POLICY
16093
16129
| PRECEDING
0 commit comments