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 CALj2ACUVDPkyRvgNpvcGKTHJZBax5Hg+4dp8Cu+61eH1ocBzEw@mail.gmail.com
Whole thread Raw
In response to Re: Skip ExecCheckRTPerms in CTAS with no data  (Anastasia Lubennikova <a.lubennikova@postgrespro.ru>)
Responses Re: Skip ExecCheckRTPerms in CTAS with no data  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
On Tue, Nov 10, 2020 at 1:18 AM Anastasia Lubennikova
<a.lubennikova@postgrespro.ru> wrote:
>
> I took a look at the patch. It is quite simple, so no comments about the
> code. It would be good to add a test to select_into.sql to show that it
> only applies to 'WITH NO DATA' and that subsequent insertions will fail
> if permissions are not set.
>

Done.

>
> Maybe we should also mention it a documentation, but I haven't found any
> specific paragraph about permissions on CTAS.
>

Yes we do not have anything related to permissions mentioned in the
documentation. So, I'm not adding it now.

Apart from the above, I also noticed that we unnecessarily allocate
bulk insert state(16MB memory) in case of WITH NO DATA, just to free
it in intorel_shutdown() without actually using it. So, in the v2
patch I have made changes to not allocate bulk insert state.

Attaching v2 patch. Consider it for further review.

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

Attachment

pgsql-hackers by date:

Previous
From: Konstantin Knizhnik
Date:
Subject: Re: avoid bitmapOR-ing indexes with scan condition inconsistent with partition constraint
Next
From: Victor Yegorov
Date:
Subject: Re: Deleting older versions in unique indexes to avoid page splits