public inbox for [email protected]  
help / color / mirror / Atom feed
From: David Steele <[email protected]>
To: Amit Langote <[email protected]>
To: Tom Lane <[email protected]>
Cc: Julien Rouhaud <[email protected]>
Cc: Pg Hackers <[email protected]>
Subject: Re: Views no longer in rangeTabls?
Date: Tue, 13 Jun 2023 09:44:44 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+HiwqF1CgsZKvBW_Gz9tErKfOp4t=PQgUKvrvWBG0HP8LdAXQ@mail.gmail.com>
References: <[email protected]>
	<CA+HiwqFC0xDCCiXbUjb-xisxo9PPuA8_ykn8Fz+6RbBJBE8mVA@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CA+HiwqFaMfM-082vwNYSAWU13T9nd62DObeNLbSTisSh6odOog@mail.gmail.com>
	<[email protected]>
	<[email protected]>
	<20230610131857.cqrsm6pwq3k47yuv@jrouhaud>
	<[email protected]>
	<CA+HiwqF1CgsZKvBW_Gz9tErKfOp4t=PQgUKvrvWBG0HP8LdAXQ@mail.gmail.com>

On 6/13/23 06:09, Amit Langote wrote:
> On Sat, Jun 10, 2023 at 10:27 PM Tom Lane <[email protected]> wrote:
>> Julien Rouhaud <[email protected]> writes:
>>> On Sat, Jun 10, 2023 at 08:56:47AM -0400, Tom Lane wrote:
>>>> -   rte->relkind = 0;
>>
>>> and also handle that field in (read|out)funcs.c
>>
>> Oh, right.  Ugh, that means a catversion bump.  It's not like
>> we've never done that during beta, but it's kind of an annoying
>> cost for a detail as tiny as this.
> 
> OK, so how about the attached?

The patch looks good to me. I also tested it against pgAudit and 
everything worked. I decided to go with the following because I think it 
is easier to read:

/* We only care about tables/views and can ignore subqueries, etc. */
if (!(rte->rtekind == RTE_RELATION ||
       (rte->rtekind == RTE_SUBQUERY && rte->relkind == RELKIND_VIEW)))
     continue;

> I considered adding Assert(relkind == RELKIND_VIEW) in all places that
> have the "rte->rtekind == RTE_SUBQUERY && OidIsValid(rte->relid)"
> condition, but that seemed like an overkill, so only added one in the
> #ifdef USE_ASSERT_CHECKING block in ExecCheckPermissions() that
> f75cec4fff877 added.

This seems like a good place for the assert.

Thanks!
-David






view thread (11+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Views no longer in rangeTabls?
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox