Re: SYSTEM_USER reserved word implementation - Mailing list pgsql-hackers

From Joe Conway
Subject Re: SYSTEM_USER reserved word implementation
Date
Msg-id 075c68a2-72a6-1be4-34da-25e73e60016d@joeconway.com
Whole thread Raw
In response to Re: SYSTEM_USER reserved word implementation  (Jacob Champion <jchampion@timescale.com>)
Responses Re: SYSTEM_USER reserved word implementation
List pgsql-hackers
On 6/22/22 11:35, Jacob Champion wrote:
> On Wed, Jun 22, 2022 at 8:10 AM Joe Conway <mail@joeconway.com> wrote:
>> --- a/src/backend/utils/init/miscinit.c
>> +++ b/src/backend/utils/init/miscinit.c
>> @@ -473,6 +473,7 @@ static Oid    AuthenticatedUserId = InvalidOid;
>>  static Oid    SessionUserId = InvalidOid;
>>  static Oid    OuterUserId = InvalidOid;
>>  static Oid    CurrentUserId = InvalidOid;
>> +static const char *SystemUser = NULL;
>>
>>  /* We also have to remember the superuser state of some of these levels */
>>  static bool AuthenticatedUserIsSuperuser = false;
> 
> What's the rationale for introducing a new global for this? A downside
> is that now there are two sources of truth, for a security-critical
> attribute of the connection.

Why would you want to do it differently than 
SessionUserId/OuterUserId/CurrentUserId? It is analogous, no?

-- 
Joe Conway
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: SYSTEM_USER reserved word implementation
Next
From: Tom Lane
Date:
Subject: Re: SYSTEM_USER reserved word implementation