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

From Michael Paquier
Subject Re: Skip ExecCheckRTPerms in CTAS with no data
Date
Msg-id 20201120053728.GC8506@paquier.xyz
Whole thread Raw
In response to Re: Skip ExecCheckRTPerms in CTAS with no data  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: Skip ExecCheckRTPerms in CTAS with no data  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Re: Skip ExecCheckRTPerms in CTAS with no data  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
List pgsql-hackers
On Thu, Nov 19, 2020 at 10:05:19PM +0530, Bharath Rupireddy wrote:
> On Thu, Nov 19, 2020 at 8:47 PM Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote:
>> Materialized views are not in the SQL standard.
>>
>> But if you consider materialized views as a variant of normal views,
>> then the INSERT privilege would be applicable if you pass an INSERT on
>> the materialized view through to the underlying tables, like for a view.

INSERT to materialized views is not supported, but perhaps you mean
having a variant of auto updatable for matviews?  I am not sure how to
clearly define that.

> For CTAS: retain the existing CREATE privilege check and remove the
> INSERT privilege check altogether for all the cases i.e. with data,
> with no data, explain analyze, plain, with execute?
> For CREATE MATERIALIZED VIEW: same as CTAS, that is retain the
> existing CREATE privilege check and remove the INSERT privilege check
> for with data, with no data, explain analyze, plain?
> For REFRESH MATERIALIZED VIEW: retain the existing behaviour i.e. no
> privilege check.

Thanks.  Based on what Peter has said, the ACL_INSERT check in
intorel_startup() could just be removed, and the tests of matview.sql
and select_into.sql would need some cleanup.  We could keep around
some scenarios with some follow-up INSERT queries after the initial
creation.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: James Hilliard
Date:
Subject: Re: [PATCH 1/1] Fix compilation on mac with Xcode >= 11.4.
Next
From: "tsunakawa.takay@fujitsu.com"
Date:
Subject: RE: CreateProcess call failed: A blocking operation was interrupted by a call to WSACancelBlockingCall