On Sat, Sep 2, 2017 at 12:21 PM, Noah Misch <n...@leadboat.com> wrote: > On Thu, Aug 31, 2017 at 03:11:10PM -0400, Robert Haas wrote: >> On Wed, Aug 30, 2017 at 11:19 AM, Robert Haas <robertmh...@gmail.com> wrote: >> > But since that's an established design fl^H^Hprinciple, maybe that >> > means we should go with the approach of teaching SerializeGUCState() >> > to ignore role altogether and instead have ParallelWorkerMain call >> > SetCurrentRoleId using information passed via the FixedParallelState >> > (not sure of the precise details here). >> >> Could I get some opinions on the virtues of this approach, vs. any of >> the other suggestions at or near >> http://postgr.es/m/ca+tgmoasp90e33-mu2ypgs73ttj37m5hv-xqhjc7tpqx9wx...@mail.gmail.com >> ? > > It seems good to me, better than the other options in that mail. >
It seems like the consensus is to move forward with this approach. I have written a patch implementing the above idea. Note, that to use SetCurrentRoleId, we need the value of guc "is_superuser" for the current user and we don't pass this value to parallel workers as this is PGC_INTERNAL guc variable. So, I have passed this value via FixedParallelState. After this patch, I think the check of InitializingParallelWorker in check_role function is redundant. I have prepared a separate patch for it, but may be it can be handled with the main patch to fix the issue. -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com
fix_role_handling_parallel_worker_v1.patch
Description: Binary data
remove_redundant_check_from_check_role_v1.patch
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers