Re: User-Id Tracking when Portal was started - Mailing list pgsql-hackers

From Tom Lane
Subject Re: User-Id Tracking when Portal was started
Date
Msg-id 8018.1341329802@sss.pgh.pa.us
Whole thread Raw
In response to Re: User-Id Tracking when Portal was started  (Kohei KaiGai <kaigai@kaigai.gr.jp>)
Responses Re: User-Id Tracking when Portal was started
List pgsql-hackers
Kohei KaiGai <kaigai@kaigai.gr.jp> writes:
> 2012/7/3 Robert Haas <robertmhaas@gmail.com>:
>> Why not just save and restore the user ID and security context
>> unconditionally, instead of doing this kind of dance?
>> 
>> +               if (portal->userId != GetUserId())
>> +                       SetUserIdAndSecContext(portal->userId, portal->secCo
>> +               else
>> +                       saveUserId = InvalidOid;
>> 
> In case when CurrentUserId was updated during the code block
> (E.g, execution of SET SESSION AUTHORIZATION), it overwrites
> this update on restoring user-id and security-context.

Um... what should happen if there was a SET SESSION AUTHORIZATION
to the portal's userId?  This test will think nothing happened.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [Review] Prevent the specification of conflicting transaction read/write options
Next
From: Andres Freund
Date:
Subject: Re: Posix Shared Mem patch