Re: get user info on log - Mailing list pgsql-general

From Adrian Klaver
Subject Re: get user info on log
Date
Msg-id dff2c688-e652-8561-890e-e783c15c8686@aklaver.com
Whole thread Raw
In response to get user info on log  (Marcos Pegoraro <marcos@f10.com.br>)
Responses Re: get user info on log
List pgsql-general
On 9/13/22 12:45, Marcos Pegoraro wrote:
> When using set role or set session authorization and an error occurs I 
> get user name which logged in and not the one I´ve changed to.
> 
> There is a way to get session_user and current_user on log ?

When I do:

test(5432)=# set role maura;
ERROR:  role "maura" does not exist
test(5432)=# SET SESSION AUTHORIZATION 'maura';
ERROR:  role "maura" does not exist


I get:

psql-postgres-2022-09-15 08:53:41.204 PDT-0ERROR:  role "maura" does not 
exist
psql-postgres-2022-09-15 08:53:41.204 PDT-0STATEMENT:  set role maura;
psql-postgres-2022-09-15 08:55:26.325 PDT-0ERROR:  role "maura" does not 
exist
psql-postgres-2022-09-15 08:55:26.325 PDT-0STATEMENT:  SET SESSION 
AUTHORIZATION 'maura';

in the logs.

Are you not seeing that or do you want something different?

If you want something different then you will need to provide a more 
detailed description of what that is.

> 
> Thanks
> Marcos


-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Mysterious performance degradation in exceptional cases
Next
From: Mladen Gogala
Date:
Subject: Re: Is it possible to stop sessions killing eachother when they all authorize as the same role?