Re: Making the subquery alias optional in the FROM clause

From: Zhihong Yu <zyu(at)yugabyte(dot)com>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Making the subquery alias optional in the FROM clause
Date: 2022-07-09 13:53:30
Message-ID: CALNJ-vRERENLhF0aKRX5RLHuk1JwYshFeXQB=wXpDxgHmicXXg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jul 9, 2022 at 5:18 AM Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
wrote:

> On Sat, 9 Jul 2022 at 12:24, Zhihong Yu <zyu(at)yugabyte(dot)com> wrote:
> >
> > It seems the code would be more readable if you keep the assignment in
> else block below:
> >
> > + else if (rte->rtekind == RTE_SUBQUERY ||
> > + rte->rtekind == RTE_VALUES)
> > continue;
> > - rtename = rte->join_using_alias->aliasname;
> > }
> > - else
> > - rtename = rte->eref->aliasname;
> >
> > because rtename would be assigned in the `rte->rtekind == RTE_JOIN` case.
> >
>
> But then it would need 2 else blocks, one inside the rte->alias ==
> NULL block, for when rtekind is not RTE_JOIN, RTE_SUBQUERY or
> RTE_VALUES, and another after the block, for when rte->alias != NULL.
> I find it more readable this way.
>
> Regards,
> Dean
>

Hi, Dean:
Thanks for the explanation.

I should have looked closer :-)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2022-07-09 14:37:22 Re: automatically generating node support functions
Previous Message Graham Leggett 2022-07-09 13:49:34 Re: [PATCH] Log details for client certificate failures