]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Rename grammar nonterminal to simplify reuse
authorPeter Eisentraut <peter@eisentraut.org>
Tue, 10 Mar 2026 12:56:52 +0000 (13:56 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Tue, 10 Mar 2026 13:09:09 +0000 (14:09 +0100)
A list of expressions with optional AS-labels is useful in a few
different places.  Right now, this is available as xml_attribute_list
because it was first used in the XMLATTRIBUTES construct, but it is
already used elsewhere, and there are other possible future uses.  To
reduce possible confusion going forward, rename it to
labeled_expr_list (like existing expr_list plus ColLabel).

Discussion: https://www.postgresql.org/message-id/flat/a855795d-e697-4fa5-8698-d20122126567@eisentraut.org

src/backend/parser/gram.y

index 9cbe8eafc4545e5c6c55f9e7bff6d6e322fee1dd..19d8a29a35ecd4bc465966435eabee8ad4797288 100644 (file)
@@ -620,8 +620,8 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
 
 %type <str>            opt_provider security_label
 
-%type <target> xml_attribute_el
-%type <list>   xml_attribute_list xml_attributes
+%type <target> labeled_expr
+%type <list>   labeled_expr_list xml_attributes
 %type <node>   xml_root_version opt_xml_root_standalone
 %type <node>   xmlexists_argument
 %type <ival>   document_or_content
@@ -16317,7 +16317,7 @@ func_expr_common_subexpr:
                                                                                           COERCE_SQL_SYNTAX,
                                                                                           @1);
                                }
-                       | XMLFOREST '(' xml_attribute_list ')'
+                       | XMLFOREST '(' labeled_expr_list ')'
                                {
                                        $$ = makeXmlExpr(IS_XMLFOREST, NULL, $3, NIL, @1);
                                }
@@ -16542,14 +16542,14 @@ opt_xml_root_standalone: ',' STANDALONE_P YES_P
                                { $$ = makeIntConst(XML_STANDALONE_OMITTED, -1); }
                ;
 
-xml_attributes: XMLATTRIBUTES '(' xml_attribute_list ')'       { $$ = $3; }
+xml_attributes: XMLATTRIBUTES '(' labeled_expr_list ')'        { $$ = $3; }
                ;
 
-xml_attribute_list:    xml_attribute_el                                        { $$ = list_make1($1); }
-                       | xml_attribute_list ',' xml_attribute_el       { $$ = lappend($1, $3); }
+labeled_expr_list:     labeled_expr                                    { $$ = list_make1($1); }
+                       | labeled_expr_list ',' labeled_expr    { $$ = lappend($1, $3); }
                ;
 
-xml_attribute_el: a_expr AS ColLabel
+labeled_expr: a_expr AS ColLabel
                                {
                                        $$ = makeNode(ResTarget);
                                        $$->name = $3;