Re: User-Id Tracking when Portal was started

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PgHacker <pgsql-hackers(at)postgresql(dot)org>, Florian Pflug <fgp(at)phlo(dot)org>
Subject: Re: User-Id Tracking when Portal was started
Date: 2012-07-03 15:36:42
Message-ID: 8018.1341329802@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Kohei KaiGai <kaigai(at)kaigai(dot)gr(dot)jp> writes:
> 2012/7/3 Robert Haas <robertmhaas(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-07-03 15:41:09 Re: Posix Shared Mem patch
Previous Message Andres Freund 2012-07-03 15:36:24 Re: Posix Shared Mem patch