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

From Peter Eisentraut
Subject Re: Skip ExecCheckRTPerms in CTAS with no data
Date
Msg-id d049c272-9a47-d783-46b0-46665b011598@enterprisedb.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  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On 2020-11-16 04:04, Michael Paquier wrote:
> On Fri, Nov 13, 2020 at 12:58:52PM +0530, Bharath Rupireddy wrote:
>> It's not required to set bistate to null as we have allocated myState
>> with palloc0 in CreateIntoRelDestReceiver, it will anyways be null.
>>    if (!into->skipData)
>>          myState->bistate = GetBulkInsertState();
>>
>> Attaching v4 patch. Please review it.
> 
> I have reviewed this one this morning, and applied it after some
> tweaks.  I have reworded some of the comments, fixed some typos, and
> largely refactored the test cases to stress all the combinations
> possible.  Please note that your patch would have caused failures
> in the buildfarm, as any role created needs to be prefixed with
> "regress_".

While this patch was nice enough to update the documentation about the 
requirement of the INSERT privilege, this is maybe more confusing now: 
How could a new table not have INSERT privilege?  Yes, you can do that 
with default privileges, but that's not well known and should be 
clarified in the documentation.

The SQL standard says that for CREATE TABLE AS, the INSERT "is 
effectively executed without further Access Rule checking", which means 
the INSERT privilege shouldn't be required at all.  I suggest we 
consider doing that instead.  I don't see a use for the current behavior.



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Add important info about ANALYZE after create Functional Index
Next
From: Tom Lane
Date:
Subject: Re: Move OpenSSL random under USE_OPENSSL_RANDOM