Re: Skip ExecCheckRTPerms in CTAS with no data - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: Skip ExecCheckRTPerms in CTAS with no data
Date
Msg-id CALj2ACXZH8=b2MjmQrPhbdPx62mph1S8CG1TvP2P78fkXnoNOA@mail.gmail.com
Whole thread Raw
In response to Re: Skip ExecCheckRTPerms in CTAS with no data  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Skip ExecCheckRTPerms in CTAS with no data
List pgsql-hackers
Thanks for the comments.

On Thu, Nov 12, 2020 at 2:36 PM Michael Paquier <michael@paquier.xyz> wrote:
>
> On Wed, Nov 11, 2020 at 07:31:49PM +0530, Bharath Rupireddy wrote:
> > Yes we do not have anything related to permissions mentioned in the
> > documentation. So, I'm not adding it now.
>
> It would be good to clarify that in the docs while we are on it.
>

Added.

>
> I don't think this is sufficient.  Could you add more test cases here?
> I can think of, coming down actually to the callers of
> CreateIntoRelDestReceiver:
> - A plain CTAS WITH NO DATA, that should pass,
> - CTAS EXECUTE WITH NO DATA, that should pass.
> - CTAS EXECUTE WITH DATA, that should not pass.
> - EXPLAIN CTAS WITH DATA, that should not pass.
>

Done.

On HEAD/master, the behaviour is as follows: a) for plain CTAS WITH NO
DATA, ExecCheckRTPerms() will not be called. b) for explain analyze
CTAS WITH NO DATA, ExecCheckRTPerms() will be called. So, we need a).
This is what exactly this patch does i.e. ExecCheckRTPerms() will not
be called for both cases.

Attaching V3 patch, please review it.

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: Alexey Kondratov
Date:
Subject: Re: Misuse of TimestampDifference() in the autoprewarm feature of pg_prewarm
Next
From: Tatsuo Ishii
Date:
Subject: Re: Implementing Incremental View Maintenance