​session_user and current_user on LOG - Mailing list pgsql-hackers

From Marcos Pegoraro
Subject ​session_user and current_user on LOG
Date
Msg-id CAB-JLwbD=SmZ=sD27YaOgFjtH+eC3wYhCU_Ovpe_-2AV+0Bzgg@mail.gmail.com
Whole thread Raw
List pgsql-hackers
Having a sup_user and a normal_user, login with sup_user
select session_user, current_user 
sup_usersup_user

set role normal_user;
select session_user, current_user 
sup_usernormal_user

But then, when sup_user was running with normal_user grants an exception occurs
select * from Some_Schema.Some_Table;

I was running with SET ROLE NORMAL_USER but I cannot see that info on LOG

user_name;error_severity;message
sup_user;ERROR;permission denied for schema Some_Schema

Would be good to have on LOG session_user / current_user if they differ, what do you think ?
Which one is better
- Put session_user / current_user on same %u prefix and fill current_user only if it differs from session_user ?
- Create another prefix for it, %o for example
thanks,
Marcos

pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: TRAP: FailedAssertion("prev_first_lsn < cur_txn->first_lsn", File: "reorderbuffer.c", Line: 927, PID: 568639)
Next
From: Ants Aasma
Date:
Subject: Re: Standby recovers records from wrong timeline