Re: Skip ExecCheckRTPerms in CTAS with no data

Peter Eisentraut <peter.eisentraut@enterprisedb.com>

From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Michael Paquier <michael@paquier.xyz>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Cc: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>, Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2020-11-20T07:29:19Z
Lists: pgsql-hackers
On 2020-11-20 06:37, Michael Paquier wrote:
>>> 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.

Not currently, but it could be a future feature.  Basically an insert 
would be passed on to the underlying tables (using INSTEAD triggers), 
and then a refresh would be triggered automatically.



Commits

  1. Remove INSERT privilege check at table creation of CTAS and matview

  2. Relax INSERT privilege requirement for CTAS and matviews WITH NO DATA