Remove duplicate initialization
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 14 Sep 2022 13:36:21 +0000 (15:36 +0200)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 14 Sep 2022 13:36:21 +0000 (15:36 +0200)
This appears to be a merge mistake in 96ef3237bf74.  We could put it
back the way it was before JSON_TABLE and it'd be two lines shorter, but
it's likely that JSON_TABLE will be back and will prefer things this
way.  It makes no other difference in practice.

Backpatch to 15.

Reported by Ranier Vilela
Discussion: https://postgr.es/m/CAEudQAr4nOcNQskC4oBEZN4S+4heJ=1ch_ZKOxU+_Ef-FQSf-g@mail.gmail.com

src/backend/parser/parse_relation.c

index f44937a8bba37ce41550fe5cdc0cdab626747c01..81f9ae2f024df8cb17fed70b58ae05b46406ea60 100644 (file)
@@ -2017,7 +2017,7 @@ addRangeTableEntryForTableFunc(ParseState *pstate,
                               bool inFromCl)
 {
    RangeTblEntry *rte = makeNode(RangeTblEntry);
-   char       *refname = alias ? alias->aliasname : pstrdup("xmltable");
+   char       *refname;
    Alias      *eref;
    int         numaliases;
 
@@ -2035,7 +2035,7 @@ addRangeTableEntryForTableFunc(ParseState *pstate,
    Assert(list_length(tf->coltypmods) == list_length(tf->colnames));
    Assert(list_length(tf->colcollations) == list_length(tf->colnames));
 
-   refname = alias ? alias->aliasname :  pstrdup("xmltable");
+   refname = alias ? alias->aliasname : pstrdup("xmltable");
 
    rte->rtekind = RTE_TABLEFUNC;
    rte->relid = InvalidOid;