Re: Adding OLD/NEW support to RETURNING

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Tomas Vondra <tomas(at)vondra(dot)me>
Subject: Re: Adding OLD/NEW support to RETURNING
Date: 2024-08-26 11:24:03
Message-ID: CAEZATCVjgVABnRrcSr011N98XAF-o4WZZWnfUm2+X0sfCbNdyw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 21 Aug 2024 at 10:07, jian he <jian(dot)universality(at)gmail(dot)com> wrote:
>
> in Var comments:
>
> * varlevelsup is greater than zero in Vars that represent outer references.
> * Note that it affects the meaning of all of varno, varnullingrels, and
> * varnosyn, all of which refer to the range table of that query level.
>
> Does this need to change accordingly?
>

No, I don't think so. varlevelsup doesn't directly change the meaning
of varreturningtype, any more than it changes the meaning of, say,
varattno. The point of that comment is that the fields varno,
varnullingrels, and varnosyn are (or contain) the range table indexes
of relations, which by themselves are insufficient to identify the
relations -- varlevelsup must be used in combination with those fields
to find the relations they refer to.

> i found there is no privilege test in src/test/regress/sql/updatable_views.sql?
> Do we need to add some tests?
>

I don't think so, because varreturningtype doesn't affect any
permissions checks.

> Other than that, I didn't find any issue.

Thanks for reviewing.

If there are no other issues, I think this is probably ready for commit.

Regards,
Dean

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Jones 2024-08-26 11:28:22 Re: [PATCH] Add CANONICAL option to xmlserialize
Previous Message Jakub Wartak 2024-08-26 11:09:58 Re: elog/ereport VS misleading backtrace_function function address