Re: [HACKERS] Parallel worker error

Поиск
Список
Период
Сортировка
От Amit Kapila
Тема Re: [HACKERS] Parallel worker error
Дата
Msg-id CAA4eK1KG9Du5G9D8g8z6eL2adsdAC6t0Vw-ofaJdGfu73zpcGQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Parallel worker error  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: [HACKERS] Parallel worker error  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
On Fri, Sep 8, 2017 at 3:18 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Mon, Sep 4, 2017 at 5:46 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
>> 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.
>
>
> With your patch, the order is wrong.  SetCurrentRoleId() is called
> AFTER SetUserIdAndSecContext().  Furthermore, the role ID passed to
> SetCurrentRoleId() is always the same one passed to
> SetUserIdAndSecContext().  But those roles might be different.
> fps->current_user_id is set by a call to GetUserIdAndSecContext(),
> which reads CurrentUserId, not OuterUserId.  I think you need to pass
> the value returned by GetCurrentRoleId() as an additional element of
> FixedParallelState.
>

You are right.  I have changed the ordering and passed OuterUserId via
FixedParallelState.


-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: [HACKERS] psql: new help related to variables are not too readable
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: [HACKERS] psql: new help related to variables are not tooreadable